Changeset 2038
- Timestamp:
- 11/13/08 16:50:40 (2 months ago)
- Files:
-
- trunk/libwzd-core/arch/win32.h (modified) (1 diff)
- trunk/libwzd-core/wzd_cache.c (modified) (5 diffs)
- trunk/libwzd-core/wzd_debug.c (modified) (5 diffs)
- trunk/libwzd-core/wzd_debug.h (modified) (2 diffs)
- trunk/libwzd-core/wzd_log.c (modified) (8 diffs)
- trunk/libwzd-core/wzd_log.h (modified) (4 diffs)
- trunk/libwzd-core/wzd_misc.c (modified) (3 diffs)
- trunk/libwzd-core/wzd_misc.h (modified) (2 diffs)
- trunk/modules/perl/libwzd_perl.c (modified) (2 diffs)
- trunk/modules/sfv/libwzd_sfv_sfv.c (modified) (2 diffs)
- trunk/modules/sfv/libwzd_sfv_site.c (modified) (2 diffs)
- trunk/modules/tcl/libwzd_tcl.c (modified) (2 diffs)
- trunk/modules/zeroconf/libwzd_bonjour.c (modified) (2 diffs)
- trunk/tests/test_wzd_log.c (modified) (2 diffs)
- trunk/wzdftpd/wzd_ServerThread.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libwzd-core/arch/win32.h
r2011 r2038 114 114 115 115 #define ftruncate(fd,pos) win32_ftruncate((fd),(__int64)(pos)) 116 int win32_ftruncate( int fd, __int64 length);116 int win32_ftruncate(fd_t fd, __int64 length); 117 117 118 118 #define readlink(path,buf,bufsiz) (-1) trunk/libwzd-core/wzd_cache.c
r2035 r2038 54 54 55 55 56 #include "wzd_types.h" 56 57 #include "wzd_structs.h" 57 58 #include "wzd_fs.h" … … 76 77 */ 77 78 struct wzd_internal_cache_t { 78 int fd;79 fd_t fd; 79 80 80 81 unsigned long filename_hash; … … 130 131 size_t length; 131 132 size_t size; 132 int fd;133 fd_t fd; 133 134 134 135 if (!file) return NULL; … … 312 313 wzd_cache_t * cache; 313 314 wzd_internal_cache_t c2, c_old; 314 int fd;315 fd_t fd; 315 316 316 317 if (!file) return NULL; … … 451 452 { 452 453 off_t position; 453 int fd;454 fd_t fd; 454 455 char buffer[4096], *ptr, *dst; 455 456 char _c=0; trunk/libwzd-core/wzd_debug.c
r1994 r2038 46 46 #include <sys/stat.h> 47 47 48 #include "wzd_types.h" 48 49 #include "wzd_structs.h" 49 50 #include "wzd_log.h" … … 66 67 struct wzd_fd { 67 68 unsigned long sig; 68 int fd;69 fd_t fd; 69 70 char file[256]; 70 71 unsigned int line; … … 79 80 #endif 80 81 81 int fd_register( int fd, const char *desc, const char *file, unsigned int line, const char *function);82 int fd_unregister( int fd, const char *desc, const char *file, unsigned int line, const char *function);82 int fd_register(fd_t fd, const char *desc, const char *file, unsigned int line, const char *function); 83 int fd_unregister(fd_t fd, const char *desc, const char *file, unsigned int line, const char *function); 83 84 void fd_dump(void); 84 85 … … 180 181 #endif /* DEBUG */ 181 182 182 int fd_register( int fd, const char *desc, const char *file, unsigned int line, const char *function)183 int fd_register(fd_t fd, const char *desc, const char *file, unsigned int line, const char *function) 183 184 { 184 185 #ifdef DEBUG … … 222 223 } 223 224 224 int fd_unregister( int fd, const char *desc, const char *file, unsigned int line, const char *function)225 int fd_unregister(fd_t fd, const char *desc, const char *file, unsigned int line, const char *function) 225 226 { 226 227 #ifdef DEBUG trunk/libwzd-core/wzd_debug.h
r1994 r2038 25 25 #ifndef __WZD_DEBUG__ 26 26 #define __WZD_DEBUG__ 27 28 #include "wzd_types.h" 27 29 28 30 #ifdef DEBUG … … 74 76 void wzd_debug_fini(void); 75 77 76 int fd_register( int fd, const char *desc, const char *file, unsigned int line, const char *function);77 int fd_unregister( int fd, const char *desc, const char *file, unsigned int line, const char *function);78 int fd_register(fd_t fd, const char *desc, const char *file, unsigned int line, const char *function); 79 int fd_unregister(fd_t fd, const char *desc, const char *file, unsigned int line, const char *function); 78 80 void fd_dump(void); 79 81 #ifdef DEBUG trunk/libwzd-core/wzd_log.c
r1997 r2038 57 57 #include <fcntl.h> /* O_WRONLY */ 58 58 59 #include "wzd_types.h" 59 60 #include "wzd_structs.h" 60 61 #include "wzd_log.h" … … 75 76 76 77 struct wzd_log_entry_t { 77 int fd;78 fd_t fd; 78 79 int syslog; 79 80 }; … … 105 106 int log_open(const char * filename, int filemode) 106 107 { 107 int fd;108 fd_t fd; 108 109 109 110 fd = open(filename, filemode, 0640); … … 114 115 } 115 116 116 void log_close( int fd)117 void log_close(fd_t fd) 117 118 { 118 119 #ifdef DEBUG … … 162 163 int log_open_old(const char *filename, int filemode) 163 164 { 164 int fd;165 fd_t fd; 165 166 166 167 fd = open(filename, filemode, 0640); … … 191 192 } 192 193 193 int log_set(unsigned int level, int fd)194 int log_set(unsigned int level, fd_t fd) 194 195 { 195 196 unsigned int i, count; … … 413 414 int xferlog_open(const char *filename, unsigned int filemode) 414 415 { 415 int fd;416 fd_t fd; 416 417 #if (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(WIN32) || defined(__APPLE__) 417 418 fd = open(filename,O_WRONLY | O_CREAT | O_APPEND, filemode); … … 422 423 } 423 424 424 void xferlog_close( int fd)425 void xferlog_close(fd_t fd) 425 426 { 426 427 close(fd); trunk/libwzd-core/wzd_log.h
r1994 r2038 25 25 #ifndef __WZD_LOG__ 26 26 #define __WZD_LOG__ 27 28 #include "wzd_types.h" 27 29 28 30 /* colors */ … … 69 71 /** \brief Close log file 70 72 */ 71 void log_close( int fd);73 void log_close(fd_t fd); 72 74 73 75 /** \brief Close all log descriptors … … 100 102 * \note fd must have been returned from log_open() 101 103 */ 102 int log_set(unsigned int level, int fd);104 int log_set(unsigned int level, fd_t fd); 103 105 104 106 /** \brief Use syslog for specified level … … 114 116 /** \brief Close xferlog file opened using \ref xferlog_open 115 117 */ 116 void xferlog_close( int fd);118 void xferlog_close(fd_t fd); 117 119 118 120 /** \brief Send message to the server logger trunk/libwzd-core/wzd_misc.c
r1994 r2038 91 91 92 92 93 #include "wzd_types.h" 93 94 #include "wzd_structs.h" 94 95 … … 517 518 } 518 519 519 time_t lget_file_ctime( int fd)520 time_t lget_file_ctime(fd_t fd) 520 521 { 521 522 fs_filestat_t s; … … 1130 1131 * which does not exist on all versions of the platform SDK. 1131 1132 */ 1132 int win32_ftruncate( int fd, __int64 length)1133 int win32_ftruncate(fd_t fd, __int64 length) 1133 1134 { 1134 1135 HANDLE handle = (HANDLE)_get_osfhandle(fd); trunk/libwzd-core/wzd_misc.h
r1994 r2038 35 35 #endif 36 36 37 #include "wzd_types.h" 37 38 #include "wzd_mutex.h" 38 39 … … 78 79 /* get file last change time */ 79 80 time_t get_file_ctime(const char *file); 80 time_t lget_file_ctime( int fd);81 time_t lget_file_ctime(fd_t fd); 81 82 82 83 /* renames file/dir, if on different fs then moves recursively */ trunk/modules/perl/libwzd_perl.c
r2026 r2038 68 68 #include <XSUB.h> 69 69 70 #include <libwzd-core/wzd_types.h> 70 71 #include <libwzd-core/wzd_structs.h> 71 72 #include <libwzd-core/wzd_log.h> … … 172 173 } 173 174 if (logdir) { 174 int fd;175 fd_t fd; 175 176 const char * filename; 176 177 trunk/modules/sfv/libwzd_sfv_sfv.c
r1994 r2038 45 45 #include <errno.h> 46 46 47 #include <libwzd-core/wzd_types.h> 47 48 #include <libwzd-core/wzd_structs.h> 48 49 #include <libwzd-core/wzd_log.h> … … 112 113 double size_total=0; 113 114 struct stat s; 114 int fd;115 fd_t fd; 115 116 int i; 116 117 trunk/modules/sfv/libwzd_sfv_site.c
r1994 r2038 50 50 51 51 /*#include "wzd.h"*/ 52 #include <libwzd-core/wzd_types.h> 52 53 #include <libwzd-core/wzd_structs.h> 53 54 #include <libwzd-core/wzd_log.h> … … 180 181 { 181 182 char buffer[2048]; 182 int fd_sfv;183 fd_t fd_sfv; 183 184 fd_sfv = open(sfv_file,O_CREAT | O_WRONLY | O_TRUNC,0644); 184 185 trunk/modules/tcl/libwzd_tcl.c
r1994 r2038 67 67 68 68 /*#include <wzd.h>*/ 69 #include <libwzd-core/wzd_types.h> 69 70 #include <libwzd-core/wzd_structs.h> 70 71 #include <libwzd-core/wzd_log.h> … … 214 215 } 215 216 if (logdir) { 216 int fd;217 fd_t fd; 217 218 218 219 wzd_string_t *str = str_allocate(); trunk/modules/zeroconf/libwzd_bonjour.c
r1660 r2038 31 31 #ifdef USE_BONJOUR 32 32 33 #include <libwzd-core/wzd_types.h> 33 34 #include "libwzd_bonjour.h" 34 35 … … 158 159 int bo_zeroconf_run(void) { 159 160 fd_set set; 160 int fd;161 fd_t fd; 161 162 struct timeval timeout; 162 163 trunk/tests/test_wzd_log.c
r2008 r2038 5 5 #include <fcntl.h> /* O_RDONLY */ 6 6 7 #include <libwzd-core/wzd_types.h> 7 8 #include <libwzd-core/wzd_structs.h> 8 9 #include <libwzd-core/wzd_log.h> … … 18 19 int ret; 19 20 char template[] = "/tmp/wzd-XXXXXX"; 20 int fd;21 fd_t fd; 21 22 unsigned long c2 = C2; 22 23 trunk/wzdftpd/wzd_ServerThread.c
r2032 r2038 1031 1031 int server_switch_to_config(wzd_config_t *config) 1032 1032 { 1033 int fd;1033 fd_t fd; 1034 1034 int ret; 1035 1035 int err; … … 1503 1503 * to create child process with a pipe (dup2 fails with error EBADF) 1504 1504 */ 1505 int fd = open("/dev/null",O_RDWR);1505 fd_t fd = open("/dev/null",O_RDWR); 1506 1506 dup2(fd,0); 1507 1507 dup2(fd,1);
