diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2016-12-04 04:32:03 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2016-12-04 04:32:03 +0100 |
commit | 3e439c3863f14c82f70666804c8570a13b3732e6 (patch) | |
tree | 07036c43e0f3f9242bb6dd42cd2a849ec8ea8aca /Src/Modules/system.c | |
parent | 2aedc4b88fd0e87b89583983951b04b96f48efd3 (diff) | |
parent | 7b7e84f0815ed22a0ee348a217776529035dccf3 (diff) | |
download | zsh-3e439c3863f14c82f70666804c8570a13b3732e6.tar.gz zsh-3e439c3863f14c82f70666804c8570a13b3732e6.zip |
Merge tag 'zsh-5.2-test-1' into debian
Diffstat (limited to 'Src/Modules/system.c')
-rw-r--r-- | Src/Modules/system.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Src/Modules/system.c b/Src/Modules/system.c index 1ab1fb17e..afaec262a 100644 --- a/Src/Modules/system.c +++ b/Src/Modules/system.c @@ -439,7 +439,7 @@ bin_sysseek(char *nam, char **args, Options ops, UNUSED(int func)) /**/ static mnumber -math_systell(UNUSED(char *name), int argc, mnumber *argv, UNUSED(int id)) +math_systell(UNUSED(char *name), UNUSED(int argc), mnumber *argv, UNUSED(int id)) { int fd = (argv->type == MN_INTEGER) ? argv->u.l : (int)argv->u.d; mnumber ret; @@ -521,7 +521,7 @@ static int bin_zsystem_flock(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { int cloexec = 1, unlock = 0, readlock = 0; - time_t timeout = 0; + zlong timeout = -1; char *fdvar = NULL; #ifdef HAVE_FCNTL_H struct flock lck; @@ -573,7 +573,7 @@ bin_zsystem_flock(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) } else { optarg = *args++; } - timeout = (time_t)mathevali(optarg); + timeout = mathevali(optarg); break; case 'u': @@ -650,7 +650,7 @@ bin_zsystem_flock(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) sleep(1); } } else { - while (fcntl(flock_fd, F_SETLKW, &lck) < 0) { + while (fcntl(flock_fd, timeout == 0 ? F_SETLK : F_SETLKW, &lck) < 0) { if (errflag) return 1; if (errno == EINTR) @@ -834,7 +834,7 @@ enables_(Module m, int **enables) /**/ int -boot_(Module m) +boot_(UNUSED(Module m)) { return 0; } |