about summary refs log tree commit diff
path: root/pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch')
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch28
1 files changed, 0 insertions, 28 deletions
diff --git a/pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch b/pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch
deleted file mode 100644
index 1d4ab5d8e71ea..0000000000000
--- a/pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -up dos2unix-3.1/dos2unix.c.preserve-file-modes dos2unix-3.1/dos2unix.c
---- dos2unix-3.1/dos2unix.c.preserve-file-modes	2008-09-08 09:58:05.000000000 +0100
-+++ dos2unix-3.1/dos2unix.c	2008-09-08 10:16:04.000000000 +0100
-@@ -320,9 +320,10 @@ int ConvertDosToUnixNewFile(char *ipInFN
-   struct stat StatBuf;
-   struct utimbuf UTimeBuf;
-   int fd;
-+  mode_t mask;
- 
-   /* retrieve ipInFN file date stamp */
--  if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
-+  if (stat(ipInFN, &StatBuf))
-     RetVal = -1;
- 
-   if((fd = MakeTempFileFrom(ipOutFN, &TempPath))<0) {
-@@ -346,6 +347,12 @@ int ConvertDosToUnixNewFile(char *ipInFN
-     RetVal = -1;
-   }
- 
-+  /* preserve original mode as modified by umask */
-+  mask = umask(0);
-+  umask(mask);
-+  if (!RetVal && fchmod(fd, StatBuf.st_mode & ~mask))
-+    RetVal = -1;
-+
-   /* conversion sucessful? */
-   if ((!RetVal) && (ConvertDosToUnix(InF, TempF, ipFlag)))
-     RetVal = -1;