]> granicus.if.org Git - graphviz/commitdiff
Quartz plugin quartzgen_begin_page: remove open coded 'MAP_FAILED'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 7 Apr 2022 00:34:09 +0000 (17:34 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 10 Apr 2022 15:31:25 +0000 (08:31 -0700)
Later on this code goes on to do an unchecked `mmap`, so it is unclear exactly
what the author believed the failure semantics of `mmap` are. Nevertheless, this
seems like a slight improvement.

plugin/quartz/gvrender_quartz.c

index 4e851b4c9978237b7589c7e6c824911dcc2ae269..91c573476f0435adfab4c202c9e46c75998f1b64 100644 (file)
@@ -210,7 +210,7 @@ static void quartzgen_begin_page(GVJ_t * job)
                                     PROT_READ | PROT_WRITE,
                                     MAP_FILE | MAP_SHARED,
                                     temp_file_descriptor, 0);
-                           if (buffer == (void *) -1)
+                           if (buffer == MAP_FAILED)
                                buffer = NULL;
                        }
                        fclose(temp_file);