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