projects
/
dss.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ee132d4
)
ipc: Fix error code returned by mutex_lock().
author
Andre Noll
<maan@tuebingen.mpg.de>
Sun, 16 Apr 2017 10:18:11 +0000
(12:18 +0200)
committer
Andre Noll
<maan@tuebingen.mpg.de>
Sun, 16 Apr 2017 10:32:06 +0000
(12:32 +0200)
In the error case do_semop() already returns the error code which
corresponds to errno.
ipc.c
patch
|
blob
|
history
diff --git
a/ipc.c
b/ipc.c
index c6f7e6b00f52c466ea051a40c188c739c7fd060b..f0a8341de57f0a7db4c25ef2944e70b8d04c33ee 100644
(file)
--- a/
ipc.c
+++ b/
ipc.c
@@
-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)