Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
NetworkManager
NetworkManager
Commits
810b0212
Commit
810b0212
authored
Jun 21, 2009
by
Tambet Ingo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: Block until netconfig exits on suse.
parent
f216af1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
src/named-manager/nm-named-manager.c
src/named-manager/nm-named-manager.c
+20
-9
No files found.
src/named-manager/nm-named-manager.c
View file @
810b0212
...
...
@@ -30,6 +30,7 @@
#include <errno.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <glib.h>
...
...
@@ -130,12 +131,12 @@ netconfig_child_setup (gpointer user_data G_GNUC_UNUSED)
setpgid
(
pid
,
pid
);
}
static
gint
run_netconfig
(
GError
**
error
)
static
GPid
run_netconfig
(
GError
**
error
,
gint
*
stdin_fd
)
{
char
*
argv
[
5
];
char
*
tmp
;
gint
stdin_fd
;
GPid
pid
=
-
1
;
argv
[
0
]
=
"/sbin/netconfig"
;
argv
[
1
]
=
"modify"
;
...
...
@@ -148,10 +149,10 @@ run_netconfig (GError **error)
g_free
(
tmp
);
if
(
!
g_spawn_async_with_pipes
(
NULL
,
argv
,
NULL
,
0
,
netconfig_child_setup
,
NULL
,
NULL
,
&
stdin_fd
,
NULL
,
NULL
,
error
))
NULL
,
&
pid
,
&
stdin_fd
,
NULL
,
NULL
,
error
))
return
-
1
;
return
stdin_f
d
;
return
pi
d
;
}
static
void
...
...
@@ -173,11 +174,13 @@ dispatch_netconfig (const char *domain,
const
char
*
iface
,
GError
**
error
)
{
gint
fd
;
char
*
str
;
GPid
pid
;
gint
fd
;
int
ret
;
f
d
=
run_netconfig
(
error
);
if
(
f
d
<
0
)
pi
d
=
run_netconfig
(
error
,
&
fd
);
if
(
pi
d
<
0
)
return
FALSE
;
write_to_netconfig
(
fd
,
"INTERFACE"
,
iface
);
...
...
@@ -205,7 +208,15 @@ dispatch_netconfig (const char *domain,
close
(
fd
);
return
TRUE
;
/* Wait until the process exits */
again:
ret
=
waitpid
(
pid
,
NULL
,
0
);
if
(
ret
<
0
&&
errno
==
EINTR
)
goto
again
;
return
ret
>
0
;
}
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment