gnulib's sys/stat.h always defines S_IRGRP, S_IXGRP, S_IXOTH.
authorPedro Alves <palves@redhat.com>
Mon, 2 Dec 2013 11:09:24 +0000 (11:09 +0000)
committerPedro Alves <palves@redhat.com>
Mon, 2 Dec 2013 11:09:24 +0000 (11:09 +0000)
Confirmed that cross building a mingw gdb still works, and also made
sure it was gnulib's sys/stat.h that was defining the values, by
hacking the header with #errors where the macros are defined.

gdb/
2013-12-02  Pedro Alves  <palves@redhat.com>

* ctf.c (ctf_start): Use S_IRGRP, S_IXGRP, S_IXOTH
unconditionally.

gdb/ChangeLog
gdb/ctf.c

index 3d8ed206ffbb3db2dc424d48bf4611a8f55630cc..ca2ca0e037823a397701db281f6d885fd0c654d6 100644 (file)
@@ -1,3 +1,8 @@
+2013-12-02  Pedro Alves  <palves@redhat.com>
+
+       * ctf.c (ctf_start): Use S_IRGRP, S_IXGRP, S_IXOTH
+       unconditionally.
+
 2013-12-02  Pedro Alves  <pedro@codesourcery.com>
             Maciej W. Rozycki  <macro@codesourcery.com>
 
index dcc4eb87411ae91a41ec648df8139aa0c7113fbd..b886d67fa18238bbc74425b9a4332cab7f084340 100644 (file)
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -313,18 +313,7 @@ ctf_start (struct trace_file_writer *self, const char *dirname)
   struct ctf_trace_file_writer *writer
     = (struct ctf_trace_file_writer *) self;
   int i;
-  mode_t hmode = S_IRUSR | S_IWUSR | S_IXUSR
-#ifdef S_IRGRP
-    | S_IRGRP
-#endif
-#ifdef S_IXGRP
-    | S_IXGRP
-#endif
-    | S_IROTH
-#ifdef S_IXOTH
-    | S_IXOTH
-#endif
-    ;
+  mode_t hmode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH;
 
   /* Create DIRNAME.  */
   if (mkdir (dirname, hmode) && errno != EEXIST)