]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Use MAP_FAILED to indicate failed mmap rather than (void \*)-1
authormmj <none@none>
Sat, 5 Jun 2004 14:55:25 +0000 (00:55 +1000)
committermmj <none@none>
Sat, 5 Jun 2004 14:55:25 +0000 (00:55 +1000)
src/mlmmj-send.c
src/mlmmj-unsub.c
src/subscriberfuncs.c

index b2c4c4d7cd5c76039c260e8c2f2693477b81279a..42bdc5762d253277e07133a84a68b36b29641353 100644 (file)
@@ -470,7 +470,7 @@ int main(int argc, char **argv)
        }
 
        mailmap = mmap(0, st.st_size, PROT_READ, MAP_SHARED, mailfd, 0);
-       if(mailmap == (void *)-1) {
+       if(mailmap == MAP_FAILED) {
                log_error(LOG_ARGS, "Could not mmap mailfd");
                exit(EXIT_FAILURE);
        }
index 54b94cf93ed9db8541f5475b3a4ab916c8aba415..a936d879bd22fee42b4d09bdd29ca9b5314b0318 100644 (file)
@@ -206,7 +206,7 @@ ssize_t unsubscribe(int subreadfd, int subwritefd, const char *address)
        }
 
        if((inmap = mmap(0, st.st_size, PROT_READ, MAP_SHARED,
-                      subreadfd, 0)) == (void *)-1) {
+                      subreadfd, 0)) == MAP_FAILED) {
                log_error(LOG_ARGS, "Could not mmap fd");
                return 1;
        }
index 0e040c7030a40d80fc4164a0a90c6281efbc7bcc..e2da008c593b18060c7a21c2ffb1d2ad91b1d05d 100644 (file)
@@ -41,7 +41,7 @@ off_t find_subscriber(int fd, const char *address)
        }
 
        if((start = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0)) ==
-                       (void *)-1) {
+                       MAP_FAILED) {
                log_error(LOG_ARGS, "Could not mmap fd");
                return (off_t)-1;
        }