Changeset 4026
- Timestamp:
- 04/03/06 21:09:36 (3 years ago)
- Files:
-
- libwired/trunk/config.h.in (modified) (5 diffs)
- libwired/trunk/configure (modified) (4 diffs)
- libwired/trunk/configure.in (modified) (3 diffs)
- libwired/trunk/libwired/data/wi-uuid.c (modified) (2 diffs)
- libwired/trunk/libwired/file/wi-file.c (modified) (2 diffs)
- libwired/trunk/libwired/file/wi-file.h (modified) (4 diffs)
- libwired/trunk/libwired/system/wi-log.c (modified) (2 diffs)
- libwired/trunk/libwired/system/wi-terminal.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libwired/trunk/config.h.in
r4019 r4026 3 3 /* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */ 4 4 #undef HAVE_CORESERVICES_CORESERVICES_H 5 6 /* Define to 1 if you have the <curses.h> header file. */ 7 #undef HAVE_CURSES_H 5 8 6 9 /* Define to 1 if you have the `daemon' function. */ … … 71 74 #undef HAVE_SRANDOM 72 75 76 /* Define to 1 if you have the `statvfs' function. */ 77 #undef HAVE_STATVFS 78 73 79 /* Define to 1 if you have the <stdint.h> header file. */ 74 80 #undef HAVE_STDINT_H … … 111 117 #undef HAVE_SYS_SOCKIO_H 112 118 119 /* Define to 1 if you have the <sys/statfs.h> header file. */ 120 #undef HAVE_SYS_STATFS_H 121 122 /* Define to 1 if you have the <sys/statvfs.h> header file. */ 123 #undef HAVE_SYS_STATVFS_H 124 113 125 /* Define to 1 if you have the <sys/stat.h> header file. */ 114 126 #undef HAVE_SYS_STAT_H … … 117 129 #undef HAVE_SYS_TYPES_H 118 130 119 /* Define to 1 if you have the <sys/vfs.h> header file. */120 #undef HAVE_SYS_VFS_H121 122 131 /* Define to 1 if you have the <termcap.h> header file. */ 123 132 #undef HAVE_TERMCAP_H … … 125 134 /* Define to 1 if you have the <termios.h> header file. */ 126 135 #undef HAVE_TERMIOS_H 136 137 /* Define to 1 if you have the <term.h> header file. */ 138 #undef HAVE_TERM_H 127 139 128 140 /* Define to 1 if you have the <unistd.h> header file. */ libwired/trunk/configure
r4019 r4026 4429 4429 4430 4430 4431 4431 4432 for ac_header in \ 4432 4433 machine/param.h \ 4433 4434 sys/sockio.h \ 4434 sys/vfs.h \ 4435 sys/statfs.h \ 4436 sys/statvfs.h \ 4435 4437 getopt.h \ 4436 4438 ifaddrs.h \ … … 4590 4592 4591 4593 4594 4595 4592 4596 for ac_header in \ 4597 curses.h \ 4598 term.h \ 4593 4599 termcap.h \ 4594 4600 termios.h \ … … 5508 5514 5509 5515 5516 5510 5517 for ac_func in \ 5511 5518 daemon \ … … 5517 5524 setproctitle \ 5518 5525 srandom \ 5526 statvfs \ 5519 5527 strcasestr \ 5520 5528 strlcat \ libwired/trunk/configure.in
r4019 r4026 193 193 machine/param.h \ 194 194 sys/sockio.h \ 195 sys/vfs.h \ 195 sys/statfs.h \ 196 sys/statvfs.h \ 196 197 getopt.h \ 197 198 ifaddrs.h \ … … 202 203 if test -n "$enable_termcap"; then 203 204 AC_CHECK_HEADERS([ \ 205 curses.h \ 206 term.h \ 204 207 termcap.h \ 205 208 termios.h \ … … 230 233 setproctitle \ 231 234 srandom \ 235 statvfs \ 232 236 strcasestr \ 233 237 strlcat \ libwired/trunk/libwired/data/wi-uuid.c
r3811 r4026 62 62 #include <sys/socket.h> 63 63 #include <sys/ioctl.h> 64 65 #ifdef HAVE_SYS_SOCKIO_H 66 #include <sys/sockio.h> 67 #endif 68 64 69 #include <unistd.h> 65 70 #include <stdlib.h> … … 441 446 struct ifconf ifc; 442 447 struct ifreq ifr, *ifrp; 443 #if def HAVE_NET_IF_DL_H448 #if !defined(SIOCGIFHWADDR) && !defined(SIOCGENADDR) && defined(HAVE_NET_IF_DL_H) 444 449 struct sockaddr_dl *sdlp; 445 450 #endif libwired/trunk/libwired/file/wi-file.c
r3828 r4026 37 37 #include <sys/stat.h> 38 38 #include <sys/mount.h> 39 40 #ifdef HAVE_SYS_STATVFS_H 41 #include <sys/statvfs.h> 42 #endif 43 44 #ifdef HAVE_SYS_STATFS_H 45 #include <sys/statfs.h> 46 #endif 47 39 48 #include <stdlib.h> 40 49 #include <unistd.h> … … 384 393 385 394 386 wi_boolean_t wi_file_statfs(wi_string_t *path, void *p) { 387 struct statfs *sfp = p; 388 389 if(statfs(wi_string_cstring(path), sfp) < 0) { 390 wi_error_set_errno(errno); 391 392 return false; 393 } 395 wi_boolean_t wi_file_statfs(wi_string_t *path, wi_file_statfs_t *sfp) { 396 #ifdef HAVE_STATVFS 397 struct statvfs sfvb; 398 399 if(statvfs(wi_string_cstring(path), &sfvb) < 0) { 400 wi_error_set_errno(errno); 401 402 return false; 403 } 404 405 sfp->f_bsize = sfvb.f_bsize; 406 sfp->f_frsize = sfvb.f_frsize; 407 sfp->f_blocks = sfvb.f_blocks; 408 sfp->f_bfree = sfvb.f_bfree; 409 sfp->f_bavail = sfvb.f_bavail; 410 sfp->f_files = sfvb.f_files; 411 sfp->f_ffree = sfvb.f_ffree; 412 sfp->f_favail = sfvb.f_favail; 413 sfp->f_fsid = sfvb.f_fsid; 414 sfp->f_flag = sfvb.f_flag; 415 sfp->f_namemax = sfvb.f_namemax; 416 #else 417 struct statfs sfb; 418 419 if(statfs(wi_string_cstring(path), &sfb) < 0) { 420 wi_error_set_errno(errno); 421 422 return false; 423 } 424 425 sfp->f_bsize = sfb.f_bsize; 426 sfp->f_frsize = sfb.f_frsize; 427 sfp->f_blocks = sfb.f_blocks; 428 sfp->f_bfree = sfb.f_bfree; 429 sfp->f_bavail = sfb.f_bavail; 430 sfp->f_files = sfb.f_files; 431 sfp->f_ffree = sfb.f_ffree; 432 sfp->f_favail = sfb.f_favail; 433 sfp->f_fsid = sfb.f_fsid; 434 sfp->f_flag = sfb.f_flag; 435 sfp->f_namemax = sfb.f_namemax; 436 #endif 394 437 395 438 return true; libwired/trunk/libwired/file/wi-file.h
r3828 r4026 33 33 #include <sys/param.h> 34 34 #include <sys/stat.h> 35 #include <sys/mount.h>36 37 #ifdef HAVE_SYS_VFS_H38 #include <sys/vfs.h>39 #endif40 41 35 #include <stdio.h> 42 36 #include <wired/wi-base.h> … … 45 39 #define WI_PATH_SIZE MAXPATHLEN 46 40 #define WI_FILE_BUFFER_SIZE BUFSIZ 41 42 43 typedef uint64_t wi_file_offset_t; 44 45 struct _wi_file_statfs { 46 uint32_t f_bsize; 47 uint32_t f_frsize; 48 uint32_t f_blocks; 49 uint32_t f_bfree; 50 uint32_t f_bavail; 51 uint32_t f_files; 52 uint32_t f_ffree; 53 uint32_t f_favail; 54 uint32_t f_fsid; 55 uint32_t f_flag; 56 uint32_t f_namemax; 57 }; 58 typedef struct _wi_file_statfs wi_file_statfs_t; 47 59 48 60 … … 55 67 56 68 57 typedef uint64_t wi_file_offset_t;58 59 69 typedef struct _wi_file wi_file_t; 60 70 … … 66 76 WI_EXPORT wi_boolean_t wi_file_stat(wi_string_t *, struct stat *); 67 77 WI_EXPORT wi_boolean_t wi_file_lstat(wi_string_t *, struct stat *); 68 WI_EXPORT wi_boolean_t wi_file_statfs(wi_string_t *, void*);78 WI_EXPORT wi_boolean_t wi_file_statfs(wi_string_t *, wi_file_statfs_t *); 69 79 WI_EXPORT wi_boolean_t wi_file_create_directory(wi_string_t *, mode_t); 70 80 WI_EXPORT wi_boolean_t wi_file_is_alias(wi_string_t *); libwired/trunk/libwired/system/wi-log.c
r3845 r4026 162 162 163 163 if(wi_log_stdout || wi_log_stderr) 164 fprintf(wi_log_stdout ? stdout : stderr, "%s %s[% d]: %s\n", date, name,getpid(), cstring);164 fprintf(wi_log_stdout ? stdout : stderr, "%s %s[%u]: %s\n", date, name, (uint32_t) getpid(), cstring); 165 165 else if(wi_log_startup && priority < LOG_INFO) 166 166 fprintf(stderr, "%s: %s\n", name, cstring); … … 177 177 178 178 if(fp) { 179 fprintf(fp, "%s %s[% d]: %s\n", date, name,getpid(), cstring);179 fprintf(fp, "%s %s[%u]: %s\n", date, name, (uint32_t) getpid(), cstring); 180 180 fclose(fp); 181 181 libwired/trunk/libwired/system/wi-terminal.c
r4025 r4026 37 37 #include <errno.h> 38 38 39 #ifdef HAVE_CURSES_H 40 #include <curses.h> 41 #endif 42 39 43 #ifdef HAVE_TERM_H 40 44 #include <term.h>
