mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-29 09:20:51 +02:00
build: fix compile warnings in DNS manager
Fixes the following warnings in nm-dns-manager.c with NETCONFIG_PATH set:
dns-manager/nm-dns-manager.c: In function 'dispatch_netconfig':
dns-manager/nm-dns-manager.c:313:2: warning: implicit declaration of function 'waitpid' [-Wimplicit-function-declaration]
ret = waitpid (pid, NULL, 0);
^
dns-manager/nm-dns-manager.c:271:14: warning: unused variable 'tmp' [-Wunused-variable]
char *str, *tmp;
^
dns-manager/nm-dns-manager.c:329:13: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
return ret > 0;
^
This commit is contained in:
parent
3db2e9d013
commit
fa19fc0a7a
1 changed files with 5 additions and 2 deletions
|
|
@ -29,6 +29,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
|
|
@ -268,10 +270,10 @@ dispatch_netconfig (char **searches,
|
|||
char **nis_servers,
|
||||
GError **error)
|
||||
{
|
||||
char *str, *tmp;
|
||||
char *str;
|
||||
GPid pid;
|
||||
gint fd;
|
||||
int ret;
|
||||
int ret = 1;
|
||||
|
||||
pid = run_netconfig (error, &fd);
|
||||
if (pid < 0)
|
||||
|
|
@ -320,6 +322,7 @@ dispatch_netconfig (char **searches,
|
|||
g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
|
||||
"Error waiting for netconfig to exit: %s",
|
||||
strerror (errno));
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue