… | |
… | |
81 | #include <fptools.h> |
81 | #include <fptools.h> |
82 | #include <uustring.h> |
82 | #include <uustring.h> |
83 | |
83 | |
84 | #include "safealloc.c" |
84 | #include "safealloc.c" |
85 | |
85 | |
86 | char * uulib_id = "$Id: uulib.c,v 1.24 2020/12/11 20:09:23 root Exp $"; |
86 | char * uulib_id = "$Id: uulib.c,v 1.25 2020/12/12 03:55:00 root Exp $"; |
87 | |
87 | |
88 | #ifdef SYSTEM_WINDLL |
88 | #ifdef SYSTEM_WINDLL |
89 | BOOL _export WINAPI |
89 | BOOL _export WINAPI |
90 | DllEntryPoint (HINSTANCE hInstance, DWORD seginfo, |
90 | DllEntryPoint (HINSTANCE hInstance, DWORD seginfo, |
91 | LPVOID lpCmdLine) |
91 | LPVOID lpCmdLine) |
… | |
… | |
730 | uustring (S_NOT_OPEN_SOURCE), |
730 | uustring (S_NOT_OPEN_SOURCE), |
731 | filename, strerror (uu_errno = errno)); |
731 | filename, strerror (uu_errno = errno)); |
732 | return UURET_IOERR; |
732 | return UURET_IOERR; |
733 | } |
733 | } |
734 | UUSETBUF (datei, datei_buf, uu_rbuf); |
734 | UUSETBUF (datei, datei_buf, uu_rbuf); |
|
|
735 | FP_flockfile (datei); |
735 | |
736 | |
736 | if (fstat (fileno(datei), &finfo) == -1) { |
737 | if (fstat (fileno(datei), &finfo) == -1) { |
737 | UUMessage (uulib_id, __LINE__, UUMSG_ERROR, |
738 | UUMessage (uulib_id, __LINE__, UUMSG_ERROR, |
738 | uustring (S_NOT_STAT_FILE), |
739 | uustring (S_NOT_STAT_FILE), |
739 | filename, strerror (uu_errno = errno)); |
740 | filename, strerror (uu_errno = errno)); |
… | |
… | |
966 | uustring (S_NOT_OPEN_FILE), |
967 | uustring (S_NOT_OPEN_FILE), |
967 | thefile->binfile, strerror (uu_errno = errno)); |
968 | thefile->binfile, strerror (uu_errno = errno)); |
968 | return UURET_IOERR; |
969 | return UURET_IOERR; |
969 | } |
970 | } |
970 | UUSETBUF (source, source_buf, uu_rbuf); |
971 | UUSETBUF (source, source_buf, uu_rbuf); |
|
|
972 | FP_flockfile (source); |
971 | |
973 | |
972 | /* |
974 | /* |
973 | * for system security, strip setuid/setgid bits from mode |
975 | * for system security, strip setuid/setgid bits from mode |
974 | */ |
976 | */ |
975 | |
977 | |
… | |
… | |
1071 | UUCLRBUF (uu_rbuf, source_buf); |
1073 | UUCLRBUF (uu_rbuf, source_buf); |
1072 | close (fildes); |
1074 | close (fildes); |
1073 | return UURET_IOERR; |
1075 | return UURET_IOERR; |
1074 | } |
1076 | } |
1075 | UUSETBUF (target, target_buf, uu_wbuf); |
1077 | UUSETBUF (target, target_buf, uu_wbuf); |
|
|
1078 | FP_flockfile (target); |
1076 | |
1079 | |
1077 | while (!FP_feof (source)) { |
1080 | while (!FP_feof (source)) { |
1078 | |
1081 | |
1079 | if (UUBUSYPOLL(ftell(source),progress.fsize)) { |
1082 | if (UUBUSYPOLL(ftell(source),progress.fsize)) { |
1080 | UUMessage (uulib_id, __LINE__, UUMSG_NOTE, |
1083 | UUMessage (uulib_id, __LINE__, UUMSG_NOTE, |