check return value of system call
This commit is contained in:
parent
eb3f3839d4
commit
3a9a59db12
@ -167,8 +167,7 @@ init_coda(int *dev, dav_run_msgloop_fn *msg_loop, void **mdata)
|
||||
++minor;
|
||||
}
|
||||
|
||||
if (*dev <= 0) {
|
||||
system("/sbin/modprobe coda &>/dev/null");
|
||||
if (*dev <= 0 && system("/sbin/modprobe coda &>/dev/null") == 0) {
|
||||
minor = 0;
|
||||
while (*dev <= 0 && minor < MAX_CODADEVS) {
|
||||
char *path;
|
||||
@ -223,8 +222,7 @@ init_fuse(int *dev, dav_run_msgloop_fn *msg_loop, void **mdata,
|
||||
abort();
|
||||
|
||||
*dev = open(path, O_RDWR | O_NONBLOCK);
|
||||
if (*dev <= 0) {
|
||||
system("/sbin/modprobe fuse &>/dev/null");
|
||||
if (*dev <= 0 && system("/sbin/modprobe fuse &>/dev/null") == 0) {
|
||||
*dev = open(path, O_RDWR | O_NONBLOCK);
|
||||
}
|
||||
if (*dev <= 0) {
|
||||
|
@ -72,6 +72,7 @@
|
||||
#include <ne_utils.h>
|
||||
|
||||
#include "defaults.h"
|
||||
#include "../gl/canonicalize.h"
|
||||
#include "mount_davfs.h"
|
||||
#include "kernel_interface.h"
|
||||
#include "cache.h"
|
||||
@ -528,7 +529,7 @@ check_dirs(dav_args *args)
|
||||
char *template = ne_concat(DAV_DATA_DIR, "/", DAV_CONFIG, NULL);
|
||||
char *command = ne_concat("cp ", template, " ", file_name,
|
||||
NULL);
|
||||
system(command);
|
||||
if (system(command) != 0);
|
||||
free(command);
|
||||
free(template);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user