Skip to content

Commit

Permalink
Unconditionally assume existence of fchown(3).
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis95 committed Feb 21, 2022
1 parent 618d174 commit cc0c874
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2020 Dennis Wölfing
Copyright (c) 2020 - 2022 Dennis Wölfing

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
3 changes: 0 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ AS_IF([test "$with_zlib" != no],

DX_ENABLE_WRAPPERS

# Dennix currently does not implement fchown.
AC_CHECK_FUNCS([fchown])

# Enable warnings on GCC.
DX_CHECK_CFLAGS([-Wall])
DX_CHECK_CFLAGS([-Wextra])
Expand Down
5 changes: 2 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2020 Dennis Wölfing
/* Copyright (c) 2020, 2022 Dennis Wölfing
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -687,13 +687,12 @@ static int processFile(int dirFd, const char* inputName, const char* outputName,
}
status = 1;
} else if (input != 0 && output != 1 && output != -1) {
#if HAVE_FCHOWN
if (fchown(output, inputStat.st_uid, inputStat.st_gid) < 0 && !quiet) {
printWarning("cannot set ownership for '%s%s%s': %s",
dirPath ? dirPath : "", dirPath ? "/" : "", outputName,
strerror(errno));
}
#endif

fchmod(output, inputStat.st_mode);
struct timespec ts[2] = { inputStat.st_atim, inputStat.st_mtim };
if (restoreName && (info.modificationTime.tv_sec != 0 ||
Expand Down

0 comments on commit cc0c874

Please sign in to comment.