diff options
Diffstat (limited to 'app-text/dos2unix/files/dos2unix-3.1-preserve-file-modes.patch')
-rw-r--r-- | app-text/dos2unix/files/dos2unix-3.1-preserve-file-modes.patch | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/app-text/dos2unix/files/dos2unix-3.1-preserve-file-modes.patch b/app-text/dos2unix/files/dos2unix-3.1-preserve-file-modes.patch deleted file mode 100644 index a357b0b138df..000000000000 --- a/app-text/dos2unix/files/dos2unix-3.1-preserve-file-modes.patch +++ /dev/null @@ -1,30 +0,0 @@ -Ripped from Fedora - ---- dos2unix-3.1/dos2unix.c -+++ dos2unix-3.1/dos2unix.c -@@ -345,11 +345,14 @@ int ConvertDosToUnixOldFile(char* ipInFN - char TempPath[16]; - struct stat StatBuf; - struct utimbuf UTimeBuf; -+ mode_t mode = S_IRUSR | S_IWUSR; - int fd; - - /* retrieve ipInFN file date stamp */ -- if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) -+ if (stat(ipInFN, &StatBuf)) - RetVal = -1; -+ else -+ mode = StatBuf.st_mode; - - strcpy (TempPath, "./u2dtmpXXXXXX"); - if((fd=mkstemp (TempPath))<0) { -@@ -357,6 +360,9 @@ int ConvertDosToUnixOldFile(char* ipInFN - RetVal = -1; - } - -+ if (!RetVal && fchmod (fd, mode) && fchmod (fd, S_IRUSR | S_IWUSR)) -+ RetVal = -1; -+ - #ifdef DEBUG - fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath); - #endif DEBUG |