X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=blobdiff_plain;f=ipc.c;h=c55554c5d3fd815cd09c045a94f7b72d5bd5db85;hp=c6f7e6b00f52c466ea051a40c188c739c7fd060b;hb=ddc8142e820ddf31c4f78fcebd359d1424f31390;hpb=03918564cf43cfbd4f873f1b9c6ec3ccd15ede91 diff --git a/ipc.c b/ipc.c index c6f7e6b..c55554c 100644 --- a/ipc.c +++ b/ipc.c @@ -228,7 +228,7 @@ error: return ret; } -static inline int get_key_or_die(char *config_file) +static int get_key_or_die(const char *config_file) { int ret; struct stat statbuf; @@ -285,7 +285,6 @@ static int do_semop(int id, struct sembuf *sops, int num) static int mutex_lock(int id) { struct sembuf sops[4]; - int ret; DSS_DEBUG_LOG(("locking\n")); @@ -305,10 +304,7 @@ static int mutex_lock(int id) sops[3].sem_op = 1; sops[3].sem_flg = SEM_UNDO | IPC_NOWAIT; - ret = do_semop(id, sops, 4); - if (ret < 0) - return -ERRNO_TO_DSS_ERROR(errno); - return 1; + return do_semop(id, sops, 4); } static bool mutex_is_locked(int id)