Package: mctools-lite
Version: 970129
Author: Guillem Jover <guillem@hadrons.org>
Status: not-sent
Description:
 Removed redundant umask calls.

diff -Nurd mctools-lite-970129/XPlaycd/discid.c mctools-lite-970129-patched/XPlaycd/discid.c
--- mctools-lite-970129/XPlaycd/discid.c	1997-01-18 07:50:05.000000000 +0100
+++ mctools-lite-970129-patched/XPlaycd/discid.c	2002-07-22 07:54:01.000000000 +0200
@@ -284,7 +284,6 @@
 static void mkdirhier(char *path) {
   char *p, *p2;
   struct stat st;
-  int umsk;
 
   /* First check if the directory already exists. */
 
@@ -301,18 +300,14 @@
 
   /* If not, scan each path component and try to create it if it is
    * missing.
-   * Be sure to use the users umask for directory creation.
    */
 
-  umsk = umask(077); umask(umsk); /* There should be a way to read it
-				   * without changing it. */
-
   if (*path=='/') p2=path+1; else p2=path;
 
   while ((p=strchr(p2, '/'))) {
     *p=0;
     if (stat(path, &st)) {
-      if (mkdir(path, 0755 & (~umsk))) {
+      if (mkdir(path, 0755)) {
 	McError(app, _("Can't create directory '%s'\nReason: %s\n"),
 		path,strerror(errno));
 	*p='/';
diff -Nurd mctools-lite-970129/XPlaycd/mkdirhier.c mctools-lite-970129-patched/XPlaycd/mkdirhier.c
--- mctools-lite-970129/XPlaycd/mkdirhier.c	1997-01-18 07:49:10.000000000 +0100
+++ mctools-lite-970129-patched/XPlaycd/mkdirhier.c	2002-07-22 07:54:35.000000000 +0200
@@ -42,7 +42,6 @@
 int mkdirhier(char *path) {
   char *p, *p2;
   struct stat st;
-  int umsk;
 
   if (!path || !strlen(path)) {
     errno=EINVAL;
@@ -67,12 +66,8 @@
 
   /* If not, scan each path component and try to create it if it is
    * missing.
-   * Be sure to use the users umask for directory creation.
    */
 
-  umsk = umask(077); umask(umsk); /* There should be a way to read it
-				   * without changing it. */
-
   if (*path=='/') p2=path+1; else p2=path;
 
   while ((p=strchr(p2, '/'))) {
@@ -81,7 +76,7 @@
 #ifdef DEBUG_MKDIRHIER
       printf("mkdir(\"%s\")\n", path);
 #endif
-      if (mkdir(path, 0755 & (~umsk))) return -1;
+      if (mkdir(path, 0755)) return -1;
     } else {
       if ((st.st_mode&S_IFMT)!=S_IFDIR) {
 	errno=ENOTDIR;
diff -Nurd mctools-lite-970129/XPlaycd/xmdb.c mctools-lite-970129-patched/XPlaycd/xmdb.c
--- mctools-lite-970129/XPlaycd/xmdb.c	1997-01-18 10:03:36.000000000 +0100
+++ mctools-lite-970129-patched/XPlaycd/xmdb.c	2002-07-22 07:55:00.000000000 +0200
@@ -454,10 +454,7 @@
  *
  */
 void new_cathegory(unsigned char *path) {
-  int umsk;
-
-  umsk = umask(077); umask(umsk);
-  if (mkdir(path, 0755 & (~umsk))) {
+  if (mkdir(path, 0755)) {
     McError(app, _("Unable to create \"%s\"\nReason: %s\n"),
 	    path, strerror(errno));
     return;
