Find attached a patch for Htags.  DJGPP (2.03) and MinGW
lack fchmod, so I close the file first and just use chmod.
Also, creat was missing the leading 0.

--
Jason.
diff -ur global-5.9.1-o\htags\htags.c global-5.9.1\htags\htags.c
--- global-5.9.1-o\htags\htags.c        Mon Jul 19 15:28:56 2010
+++ global-5.9.1\htags\htags.c  Tue Jul 20 11:04:54 2010
@@ -1807,14 +1807,14 @@
                snprintf(path, sizeof(path), "%s/gtags/%s/%s", datadir, name, 
id);
                if (test("f", path) && overwrite_key == 0)
                        die("key '%s' is not unique. please change key or use 
--overwrite-key option.", id);
-               fd = creat(path, 644);
+               fd = creat(path, 0644);
                if (fd < 0)
                        die("cannot create file '%s'.", path);
                write(fd, distpath, strlen(distpath));
                write(fd, "\n", 1);
-               if (fchmod(fd, 0644) < 0)
-                       die("cannot chmod file '%s'(errono = %d).", path, 
errno);
                close(fd);
+               if (chmod(path, 0644) < 0)
+                       die("cannot chmod file '%s'(errno = %d).", path, errno);
        }
        /* --action, --id overwrite Sflag's value. */
        if (action_value) {
_______________________________________________
Bug-global mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-global

Reply via email to