Fossil SCM

Get the build working on Windows again.

drh 2024-08-06 20:36 unix-sockets
Commit d474c95d5a35c66b247a7a80415e8d1e39a00b20f5bd0fad7d62e75290d700e8
1 file changed +4
+4
--- src/file.c
+++ src/file.c
@@ -730,23 +730,26 @@
730730
731731
/*
732732
** Change access permissions on a file.
733733
*/
734734
void file_set_mode(const char *zFN, int fd, const char *zMode, int bNoErr){
735
+#if !defined(_WIN32)
735736
mode_t m;
736737
char *zEnd = 0;
737738
m = strtol(zMode, &zEnd, 0);
738739
if( (zEnd[0] || fchmod(fd, m)) && !bNoErr ){
739740
fossil_fatal("cannot change permissions on %s to \"%s\"",
740741
zFN, zMode);
741742
}
743
+#endif
742744
}
743745
744746
/* Change the owner of a file to zOwner. zOwner can be of the form
745747
** USER:GROUP.
746748
*/
747749
void file_set_owner(const char *zFN, int fd, const char *zOwner){
750
+#if !defined(_WIN32)
748751
const char *zGrp;
749752
const char *zUsr = zOwner;
750753
struct passwd *pw;
751754
struct group *grp;
752755
uid_t uid = -1;
@@ -773,10 +776,11 @@
773776
fossil_fatal("cannot change ownership of %s to %s",zFN, zOwner);
774777
}
775778
if( zOwner!=zUsr ){
776779
fossil_free((char*)zUsr);
777780
}
781
+#endif
778782
}
779783
780784
781785
/*
782786
** Delete a file.
783787
--- src/file.c
+++ src/file.c
@@ -730,23 +730,26 @@
730
731 /*
732 ** Change access permissions on a file.
733 */
734 void file_set_mode(const char *zFN, int fd, const char *zMode, int bNoErr){
 
735 mode_t m;
736 char *zEnd = 0;
737 m = strtol(zMode, &zEnd, 0);
738 if( (zEnd[0] || fchmod(fd, m)) && !bNoErr ){
739 fossil_fatal("cannot change permissions on %s to \"%s\"",
740 zFN, zMode);
741 }
 
742 }
743
744 /* Change the owner of a file to zOwner. zOwner can be of the form
745 ** USER:GROUP.
746 */
747 void file_set_owner(const char *zFN, int fd, const char *zOwner){
 
748 const char *zGrp;
749 const char *zUsr = zOwner;
750 struct passwd *pw;
751 struct group *grp;
752 uid_t uid = -1;
@@ -773,10 +776,11 @@
773 fossil_fatal("cannot change ownership of %s to %s",zFN, zOwner);
774 }
775 if( zOwner!=zUsr ){
776 fossil_free((char*)zUsr);
777 }
 
778 }
779
780
781 /*
782 ** Delete a file.
783
--- src/file.c
+++ src/file.c
@@ -730,23 +730,26 @@
730
731 /*
732 ** Change access permissions on a file.
733 */
734 void file_set_mode(const char *zFN, int fd, const char *zMode, int bNoErr){
735 #if !defined(_WIN32)
736 mode_t m;
737 char *zEnd = 0;
738 m = strtol(zMode, &zEnd, 0);
739 if( (zEnd[0] || fchmod(fd, m)) && !bNoErr ){
740 fossil_fatal("cannot change permissions on %s to \"%s\"",
741 zFN, zMode);
742 }
743 #endif
744 }
745
746 /* Change the owner of a file to zOwner. zOwner can be of the form
747 ** USER:GROUP.
748 */
749 void file_set_owner(const char *zFN, int fd, const char *zOwner){
750 #if !defined(_WIN32)
751 const char *zGrp;
752 const char *zUsr = zOwner;
753 struct passwd *pw;
754 struct group *grp;
755 uid_t uid = -1;
@@ -773,10 +776,11 @@
776 fossil_fatal("cannot change ownership of %s to %s",zFN, zOwner);
777 }
778 if( zOwner!=zUsr ){
779 fossil_free((char*)zUsr);
780 }
781 #endif
782 }
783
784
785 /*
786 ** Delete a file.
787

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button