mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-30 04:33:00 +02:00
src/net: must close each pipe before exectuing the next pipe action
For instance, when adding ip command to the ip pipe we need the kernel to execute those commands before the bridge command pipe is executed. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
committed by
Tobias Waldekranz
parent
2de8ff052d
commit
45c6b704f9
+9
-2
@@ -223,12 +223,13 @@ static int iter(char *path, size_t len, const char *action)
|
||||
{
|
||||
char **files;
|
||||
int rc = 0;
|
||||
FILE *pp;
|
||||
int num;
|
||||
|
||||
num = dir(path, NULL, dir_filter, &files, 0);
|
||||
|
||||
for (int j = 0; j < num; j++) {
|
||||
char *ifname = files[j];
|
||||
for (int i = 0; i < num; i++) {
|
||||
char *ifname = files[i];
|
||||
char ipath[len];
|
||||
|
||||
snprintf(ipath, sizeof(ipath), "%s/%s", path, ifname);
|
||||
@@ -240,6 +241,12 @@ static int iter(char *path, size_t len, const char *action)
|
||||
|
||||
freeifs();
|
||||
|
||||
pp = pipep(action);
|
||||
if (pp) {
|
||||
log("closing pipe for %s", action);
|
||||
pclose(pp);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user