mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 18:14:24 +08:00
Fix compilation on OSX in ntfscmp.c where stderr = stdout is not legal (but
happens to work on Linux) to do portable low-level file descriptor mangling.
This commit is contained in:
parent
f5961c075e
commit
da1495a11d
@ -12,9 +12,9 @@ xx/xx/2005 - 1.12.2-WIP
|
||||
- Fix silly bug introduced in 1.12.0 which breaks ntfsfix (and others
|
||||
possibly) when calling ntfs_attr_lookup() with AT_UNNAMED name and
|
||||
no ntfs inode in the search context. (Anton)
|
||||
- Fix compilation on OSX in ntfsresize.c and ntfsclone.c where stderr =
|
||||
stdout is not legal (but happens to work on Linux) to do proper
|
||||
low-level file descriptor mangling which is portable. (Anton)
|
||||
- Fix compilation on OSX in ntfsresize.c, ntfsclone.c, and ntfscmp.c
|
||||
where stderr = stdout is not legal (but happens to work on Linux) to
|
||||
do portable low-level file descriptor mangling. (Anton)
|
||||
- Add test/runlist-data to EXTRA_DIST so it gets included in the
|
||||
distribution otherwise make test fails on released sources. Solution
|
||||
is not perfect as it also adds the test/runlist-data/CVS directory
|
||||
|
@ -224,13 +224,20 @@ static void parse_options(int argc, char **argv)
|
||||
usage();
|
||||
}
|
||||
|
||||
stderr = stdout;
|
||||
/* Redirect stderr to stdout, note fflush()es are essential! */
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
if (dup2(STDOUT_FILENO, STDERR_FILENO) == -1) {
|
||||
perror("Failed to redirect stderr to stdout");
|
||||
exit(1);
|
||||
}
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (!opt.debug)
|
||||
if (!(stderr = fopen("/dev/null", "rw")))
|
||||
perr_exit("Couldn't open /dev/null");
|
||||
|
||||
if (!freopen("/dev/null", "w", stderr))
|
||||
perr_exit("Failed to redirect stderr to /dev/null");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user