| tModifications made to placate "splint":- - Explicit (void) cast added to ignor… | |
| git clone git://src.adamsgaard.dk/vaccinewars | |
| Log | |
| Files | |
| Refs | |
| README | |
| LICENSE | |
| --- | |
| commit 962043b54f74a02320e6e4a1639bdc4b36ce502c | |
| parent 8b171504a7e2a3cee902c6e438424b9524f12836 | |
| Author: Ben Webb <[email protected]> | |
| Date: Tue, 24 Sep 2002 11:35:57 +0000 | |
| Modifications made to placate "splint":- | |
| - Explicit (void) cast added to ignore the return value of DoLock() | |
| - Unreachable code removed | |
| Diffstat: | |
| M src/util.c | 11 +++++------ | |
| 1 file changed, 5 insertions(+), 6 deletions(-) | |
| --- | |
| diff --git a/src/util.c b/src/util.c | |
| t@@ -201,12 +201,11 @@ static int DoLock(FILE * fp, int l_type) | |
| lk.l_whence = lk.l_start = lk.l_len = 0; | |
| lk.l_pid = 0; | |
| - while (1) { | |
| - if (fcntl(fileno(fp), F_SETLKW, &lk) == 0) | |
| + do { | |
| + if (fcntl(fileno(fp), F_SETLKW, &lk) == 0) { | |
| return 0; | |
| - else if (errno != EINTR) | |
| - return 1; | |
| - } | |
| + } | |
| + } while (errno == EINTR); | |
| return 1; | |
| } | |
| t@@ -222,7 +221,7 @@ int WriteLock(FILE * fp) | |
| void ReleaseLock(FILE * fp) | |
| { | |
| - DoLock(fp, F_UNLCK); | |
| + (void)DoLock(fp, F_UNLCK); | |
| } | |
| #endif /* CYGWIN */ |