浏览代码

- tests again

Andrei Pelinescu-Onciul 23 年之前
父节点
当前提交
b4e6d25ec6
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      test/ifls.c

+ 4 - 1
test/ifls.c

@@ -131,9 +131,10 @@ int ls_ifflags(char* name, int family , int options)
 		/*if (ifr.ifr_flags & IFF_DYNAMIC ) printf ("DYNAMIC ");*/
 		/*if (ifr.ifr_flags & IFF_DYNAMIC ) printf ("DYNAMIC ");*/
 		printf ("\n");
 		printf ("\n");
 	};
 	};
-
+	close(s);
 	return 0;
 	return 0;
 error:
 error:
+	close(s);
 	return -1;
 	return -1;
 }
 }
 
 
@@ -209,8 +210,10 @@ int ls_ifs(char* name, int family, int options)
 		}
 		}
 	}
 	}
 	free(ifc.ifc_req); /*clean up*/
 	free(ifc.ifc_req); /*clean up*/
+	close(s);
 	return  0;
 	return  0;
 error:
 error:
+	close(s);
 	return -1;
 	return -1;
 }
 }