- Timestamp:
- Dec 31, 2005, 2:02:03 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/slib.h
r1 r8 349 349 int sl_read (SL_TICKET ticket, void * buf, size_t count); 350 350 351 int sl_read_timeout_prep (SL_TICKET ticket); 352 351 353 int sl_read_timeout (SL_TICKET ticket, void * buf, 352 354 size_t count, int timeout); -
trunk/src/sh_files.c
r5 r8 229 229 tmp = sh_util_safe_name (ptr->name); 230 230 #endif 231 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_CHK, 232 tmp); 231 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_CHK, tmp); 233 232 } 234 233 … … 1457 1456 } 1458 1457 1459 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_CHK, 1460 tmpname); 1461 1458 if (flag_err_info == SL_TRUE) 1459 { 1460 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_CHK, tmpname); 1461 } 1462 1462 1463 /* ---- check input ---- 1463 1464 */ -
trunk/src/sh_hash.c
r3 r8 71 71 static char * unquote_string (char * str) 72 72 { 73 int i = 0, j, k = 0, len ;74 char * tmp ;73 int i = 0, j, k = 0, len, t1, t2, l2; 74 char * tmp = NULL; 75 75 76 76 SL_ENTER(_("unquote_string")); 77 77 78 if (str == NULL) 79 { 80 SL_RETURN(NULL, _("unquote_string")); 81 } 82 83 len = sl_strlen(str); 84 85 tmp = SH_ALLOC(len + 1); 86 for (j = 0; j <= len; ++j) 87 { 88 if (str[j] == QUOTE_CHAR && j < (len-2)) 89 { 90 if (sh_util_hexchar(str[j+1]) >= 0 && sh_util_hexchar(str[j+2]) >= 0) 91 { 92 i = 16 * sh_util_hexchar(str[j+1]) + sh_util_hexchar(str[j+2]); 93 tmp[k] = i; j += 2; 94 } 95 else 78 if (str != NULL) 79 { 80 len = sl_strlen(str); 81 l2 = len - 2; 82 tmp = SH_ALLOC(len + 1); 83 84 for (j = 0; j <= len; ++j) 85 { 86 if (str[j] != QUOTE_CHAR) 96 87 { 97 88 tmp[k] = str[j]; 98 89 } 99 } 100 else 101 tmp[k] = str[j]; 102 ++k; 90 else if (str[j] == QUOTE_CHAR && j < l2) 91 { 92 t1 = sh_util_hexchar(str[j+1]); 93 t2 = sh_util_hexchar(str[j+2]); 94 if ((t1|t2) >= 0) 95 { 96 i = 16 * t1 + t2; 97 tmp[k] = i; 98 j += 2; 99 } 100 else 101 { 102 tmp[k] = str[j]; 103 } 104 } 105 else 106 tmp[k] = str[j]; 107 ++k; 108 } 103 109 } 104 110 SL_RETURN(tmp, _("unquote_string")); … … 306 312 307 313 /* must fit an int */ 308 #define TABSIZE 2048 314 /* #define TABSIZE 2048 */ 315 #define TABSIZE 65536 309 316 310 317 /* must fit an unsigned short */ … … 386 393 * 387 394 **************************************************************/ 395 388 396 static int hashfunc(char *s) 389 397 { … … 392 400 for ( ; *s; s++) 393 401 n = 31 * n + *s; 394 return n % TABSIZE;402 return n & 0xFFFF;/* % TABSIZE*/; 395 403 } 404 396 405 397 406 int hashreport_missing( char *fullpath, int level) … … 635 644 SL_ENTER(_("hashsearch")); 636 645 637 if ( !s)638 SL_RETURN( NULL, _("hashsearch"));639 640 for (p = tab[hashfunc(s)]; p; p = p->next)641 if ((p->fullpath != NULL) && (0 == strcmp(s, p->fullpath))) 642 SL_RETURN( p, _("hashsearch"));646 if (s) 647 { 648 for (p = tab[hashfunc(s)]; p; p = p->next) 649 if ((p->fullpath != NULL) && (0 == strcmp(s, p->fullpath))) 650 SL_RETURN( p, _("hashsearch")); 651 } 643 652 SL_RETURN( NULL, _("hashsearch")); 644 653 } … … 672 681 { 673 682 if (p && p->fullpath && 674 0 == strcmp(s->fullpath, p->fullpath) && 675 strlen(s->fullpath) == strlen(p->fullpath)) 683 0 == strcmp(s->fullpath, p->fullpath)) 676 684 { 677 685 q = p->next; … … 3064 3072 int hash_remove_tree (char * s) 3065 3073 { 3066 sh_file_t * p;3067 intlen;3068 inti;3074 sh_file_t * p; 3075 size_t len; 3076 unsigned int i; 3069 3077 3070 3078 SL_ENTER(_("hash_remove_tree")); 3071 3079 3072 if (!s )3080 if (!s || *s == '\0') 3073 3081 SL_RETURN ((-1), _("hash_remove_tree")); 3074 else 3075 3082 3083 len = sl_strlen(s); 3076 3084 3077 3085 if (IsInit != 1) … … 3082 3090 for (p = tab[i]; p; p = p->next) 3083 3091 { 3084 if ( sl_strncmp(s, p->fullpath, len) == 0)3092 if (p->fullpath && 0 == strncmp(s, p->fullpath, len)) 3085 3093 { 3086 3094 p->allignore = S_TRUE; -
trunk/src/sh_prelink.c
r1 r8 74 74 int sh_prelink_iself (SL_TICKET fd, off_t size, int alert_timeout) 75 75 { 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 76 long status; 77 char magic[4]; 78 if (size < 42) 79 return S_FALSE; 80 status = sl_read_timeout (fd, magic, 4, alert_timeout); 81 (void) sl_rewind(fd); 82 if (status == 4) 83 { 84 /*@-usedef@*/ 85 if (magic[0] == (char) 0x7f && 86 magic[1] == 'E' && 87 magic[2] == 'L' && 88 magic[3] == 'F') 89 return S_TRUE; 90 /*@+usedef@*/ 91 } 92 return S_FALSE; 93 93 } 94 94 … … 242 242 */ 243 243 tiger_fd = task.pipeTI; 244 245 sl_read_timeout_prep (task.pipeTI); 246 244 247 strcpy(file_hash, /* known to fit */ 245 248 sh_tiger_generic_hash (path, TIGER_FD, 0, alert_timeout)); -
trunk/src/sh_tiger0.c
r1 r8 95 95 SL_TICKET tiger_fd = (-1); 96 96 97 static sh_byte buffer[PRIV_MAX + 72]; 97 98 98 99 #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) … … 108 109 { 109 110 SL_TICKET fd; 110 int i, j ;111 int i, j, tt; 111 112 int count = 0; 112 113 int blk; 113 114 char * tmp; 114 115 sh_byte * bptr; 115 sh_byte buffer[PRIV_MAX + 72];116 /* sh_byte buffer[PRIV_MAX + 72]; */ 116 117 sh_byte bbuf[64]; 118 119 static int lockflag = SL_FALSE; 117 120 118 121 unsigned long pages_read; … … 148 151 SL_ENTER(_("sh_tiger_hash_val")); 149 152 150 if (what == TIGER_FILE || what == TIGER_FD) 151 { 152 if (what == TIGER_FILE) 153 if (what == TIGER_FD || what == TIGER_FILE) 154 { 155 if (what == TIGER_FD) 156 { 157 fd = tiger_fd; 158 TPT((0,FIL__, __LINE__, _("msg=<TIGER_FD>, fd=<%ld>\n"), tiger_fd)); 159 } 160 else 153 161 { 154 162 TPT((0,FIL__, __LINE__, _("msg=<TIGER_FILE>, path=<%s>\n"), 155 163 (filename == NULL ? _("(null)") : filename) )); 156 164 fd = sl_open_read (filename, SL_YESPRIV); 157 }158 else159 {160 fd = tiger_fd;161 TPT((0,FIL__, __LINE__, _("msg=<TIGER_FD>, fd=<%ld>\n"), tiger_fd));162 165 } 163 166 … … 174 177 175 178 #if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK) 176 if ( skey->mlock_failed == SL_FALSE)179 if (lockflag == SL_FALSE && skey->mlock_failed == SL_FALSE) 177 180 { 178 181 if ( (-1) == sh_unix_mlock((char *)buffer,(PRIV_MAX)*sizeof(sh_byte))) 179 182 skey->mlock_failed = SL_TRUE; 183 lockflag = SL_TRUE; 180 184 } 181 185 #else 182 if (skey->mlock_failed == SL_FALSE) 183 skey->mlock_failed = SL_TRUE; 186 if (lockflag == SL_FALSE && skey->mlock_failed == SL_FALSE) 187 { 188 skey->mlock_failed = SL_TRUE; 189 lockflag = SL_TRUE; 190 } 184 191 #endif 185 192 … … 190 197 pages_read = 0; 191 198 192 while (1 == 1)199 while (1) 193 200 { 194 201 if (timeout > 0) … … 217 224 count, MSG_E_READ, tmp); 218 225 SH_FREE(tmp); 219 (void) sh_unix_munlock((char*)buffer, (PRIV_MAX)*sizeof(sh_byte)); 226 memset (bbuf, 0, 64); 227 memset (buffer, 0, PRIV_MAX); 228 220 229 SL_RETURN( NULL, _("sh_tiger_hash_val")); 221 230 } 222 223 /* TPT((0, FIL__, __LINE__ , _("msg=<Read %ld bytes>\n"), count)); */224 231 225 232 blk = (count / 64); /* number of 64-byte words */ … … 228 235 * count cannot be negative here, see 'if (SL_ISERROR (count))' 229 236 */ 230 ncount = (unsigned long) (count - ((count/64)*64)); 237 tt = blk*64; 238 239 ncount = (unsigned long) (count - tt); 240 241 nblocks += blk; 242 sh.statistics.bytes_hashed += tt; 231 243 232 bptr = buffer; 244 bptr = buffer; tt = 0; 233 245 for (i = 0; i < blk; ++i) 234 246 { 235 bptr = &buffer[ 64 * i];247 bptr = &buffer[tt]; tt += 64; 236 248 237 249 tiger_t(TIGER_CAST bptr, 64, res); 238 ++nblocks;239 sh.statistics.bytes_hashed += 64;240 250 241 251 #ifdef TIGER_DBG … … 252 262 memset (bbuf, 0, 64); 253 263 memset (buffer, 0, PRIV_MAX); 254 (void) sh_unix_munlock( (char *) buffer, 255 (PRIV_MAX) * sizeof(sh_byte)); 264 256 265 SL_RETURN( NULL, _("sh_tiger_hash_val")); 257 266 } … … 268 277 /* copy incomplete block 269 278 */ 270 j = 0; for (i = 0; i < 64; ++i) 271 bbuf[i] = (sh_byte) '\0'; 279 j = 0; 280 for (i = 0; i < 64; i += 4) 281 { 282 bbuf[i] = (sh_byte) '\0'; 283 bbuf[i+1] = (sh_byte) '\0'; 284 bbuf[i+2] = (sh_byte) '\0'; 285 bbuf[i+3] = (sh_byte) '\0'; 286 } 272 287 for (i = (count/64) * 64; i < count; ++i) 273 288 /*@-usedef@*/bbuf[j++] = buffer[i];/*@+usedef@*/ … … 304 319 sh.statistics.bytes_hashed += 64; 305 320 ++nblocks; ncount = 0; 306 memset(bbuf, 0, 56 ); 321 for (i = 0; i < 56; i += 4) 322 { 323 bbuf[i] = (sh_byte) '\0'; 324 bbuf[i+1] = (sh_byte) '\0'; 325 bbuf[i+2] = (sh_byte) '\0'; 326 bbuf[i+3] = (sh_byte) '\0'; 327 } 328 /* memset(bbuf, 0, 56 ); */ 307 329 } 308 330 … … 327 349 #endif 328 350 329 memset (bbuf, 0, 64); 330 memset (buffer, 0, PRIV_MAX); 331 332 (void) sh_unix_munlock( (char *) buffer, (PRIV_MAX) * sizeof(sh_byte)); 351 for (i = 0; i < 64; i += 4) 352 { 353 bbuf[i] = (sh_byte) '\0'; 354 bbuf[i+1] = (sh_byte) '\0'; 355 bbuf[i+2] = (sh_byte) '\0'; 356 bbuf[i+3] = (sh_byte) '\0'; 357 } 358 359 bptr = buffer; 360 361 memcpy(bptr, bbuf, 64); bptr += 64; 362 memcpy(bptr, bbuf, 64); bptr += 64; 363 memcpy(bptr, buffer, 128); bptr += 128; 364 memcpy(bptr, buffer, 256); bptr += 256; 365 memcpy(bptr, buffer, 512); bptr += 512; 366 memcpy(bptr, buffer,1024); bptr += 1024; 367 memcpy(bptr, buffer,2048); 333 368 334 369 if (what == TIGER_FILE) … … 343 378 if (what == TIGER_DATA && filename != NULL) 344 379 { 345 /* TPT((0, FIL__, __LINE__, _("msg=<TIGER_DATA>\n"))); */346 380 tiger(TIGER_CAST filename, (sh_word32) Length, res); 347 381 SL_RETURN(res, _("sh_tiger_hash_val")); … … 1158 1192 SL_TICKET fd; 1159 1193 char * tmp; 1160 uid_t 1194 uid_t euid; 1161 1195 1162 1196 unsigned long pages_read; -
trunk/src/sh_unix.c
r1 r8 1194 1194 setrlimit (RLIMIT_NPROC, &limits); 1195 1195 #endif 1196 #ifdef RLIMIT_MEMLOCK 1197 setrlimit (RLIMIT_MEMLOCK, &limits); 1198 #endif 1199 1200 #if !defined(SL_DEBUG) 1201 /* no core dumps 1202 */ 1203 limits.rlim_cur = 0; 1204 limits.rlim_max = 0; 1205 #ifdef RLIMIT_CORE 1206 setrlimit (RLIMIT_CORE, &limits); 1207 #endif 1208 #else 1209 #ifdef RLIMIT_CORE 1210 setrlimit (RLIMIT_CORE, &limits); 1211 #endif 1212 #endif 1213 1214 limits.rlim_cur = 1024; 1215 limits.rlim_max = 1024; 1216 1196 1217 #if defined(RLIMIT_NOFILE) 1197 1218 setrlimit (RLIMIT_NOFILE, &limits); … … 1199 1220 setrlimit (RLIMIT_OFILE, &limits); 1200 1221 #endif 1201 #ifdef RLIMIT_MEMLOCK1202 setrlimit (RLIMIT_MEMLOCK, &limits);1203 #endif1204 1205 #if !defined(SL_DEBUG)1206 /* no core dumps1207 */1208 limits.rlim_cur = 0;1209 limits.rlim_max = 0;1210 #ifdef RLIMIT_CORE1211 setrlimit (RLIMIT_CORE, &limits);1212 #endif1213 #else1214 #ifdef RLIMIT_CORE1215 setrlimit (RLIMIT_CORE, &limits);1216 #endif1217 #endif1218 1219 1222 1220 1223 SL_RET0(_("sh_unix_setlimits")); … … 2696 2699 struct stat fbuf; 2697 2700 int stat_return; 2698 register int i; 2701 2699 2702 ShFileType type; 2700 2703 unsigned int mode; … … 2702 2705 char * tmp; 2703 2706 char * tmp2; 2704 /* char * p; */ 2707 2705 2708 char * linknamebuf; 2706 2709 int linksize; … … 2710 2713 SL_TICKET rval_open; 2711 2714 int fd; 2712 #if defined(__linux__)2713 int fd_2;2714 #endif2715 2715 int fstat_return; 2716 2716 … … 2738 2738 */ 2739 2739 tstart = time(NULL); 2740 2740 2741 stat_return = retry_lstat (FIL__, __LINE__, 2741 2742 path /* theFile->fullpath */, &buf); 2742 2743 2744 fd = -1; 2745 fstat_return = -1; 2746 rval_open = -1; 2747 2743 2748 if (stat_return == 0 && S_ISREG(buf.st_mode)) 2744 2749 { … … 2747 2752 alert_timeout = 120; /* this is per 8K block now ! */ 2748 2753 2749 if (path[ 0] == '/' && path[1] == 'p' && path[2] == 'r' &&2750 path[3] == 'o' && path[4] == 'c' && path[ 5] == '/')2754 if (path[1] == 'p' && path[5] == '/' && path[2] == 'r' && 2755 path[3] == 'o' && path[4] == 'c' && path[0] == '/') 2751 2756 { 2752 2757 /* seven is magic */ 2753 2758 alert_timeout = 7; 2754 2759 } 2755 } 2756 else 2757 rval_open = -1; 2758 2759 if (SL_ISERROR(rval_open)) 2760 fd = -1; 2761 else 2762 fd = get_the_fd(rval_open); 2760 2761 fd = get_the_fd(rval_open); 2762 } 2763 2763 2764 2764 tend = time(NULL); … … 2774 2774 SH_FREE(tmp2); 2775 2775 } 2776 2777 if (fd >= 0) 2778 fstat_return = retry_fstat (FIL__, __LINE__, fd, &fbuf); 2779 else 2780 fd = -1; 2776 2781 2777 if (fd >= 0)2778 {2779 fstat_return = retry_fstat (FIL__, __LINE__, fd, &fbuf);2780 }2781 else2782 {2783 fstat_return = -1;2784 fd = -1;2785 }2786 #if defined(__linux__)2787 fd_2 = fd;2788 #endif2789 2782 2790 2783 /* --- case 1: lstat failed --- … … 2809 2802 } 2810 2803 2811 /* --- case 2: not a regular file , or [IgnoreAll]---2804 /* --- case 2: not a regular file --- 2812 2805 */ 2813 2806 else if (! S_ISREG(buf.st_mode)) … … 2906 2899 /* --- Determine file type. --- 2907 2900 */ 2908 for (i = 0; i < 10; ++i) theFile->c_mode[i] = '-';2901 memset (theFile->c_mode, '-', 10); 2909 2902 theFile->c_mode[10] = '\0'; 2910 for (i = 0; i < 11; ++i) theFile->link_c_mode[i] = '-'; 2903 2904 memset (theFile->link_c_mode, '-', 10); 2911 2905 theFile->link_c_mode[10] = '\0'; 2912 2906 … … 2918 2912 /* --- Determine file attributes. --- 2919 2913 */ 2920 for (i = 0; i < 12; ++i) theFile->c_attributes[i] = '-';2914 memset (theFile->c_attributes, '-', 12); 2921 2915 theFile->c_attributes[12] = '\0'; 2922 2916 theFile->attributes = 0; … … 2925 2919 theFile->c_mode[0] != 'l' ) 2926 2920 sh_unix_getinfo_attr(theFile->fullpath, 2927 &theFile->attributes, theFile->c_attributes, fd _2);2921 &theFile->attributes, theFile->c_attributes, fd); 2928 2922 2929 2923 #endif -
trunk/src/slib.c
r5 r8 566 566 void *sl_memset(void *s, int c, size_t n) 567 567 { 568 size_t i; 569 volatile char *p = s; 570 571 if (s == NULL || n <= 0) 572 return s; 573 574 for (i = 0; i < n; ++i) 575 p[i] = (char) c; 568 volatile char *p = (char *) s; 569 570 if (s != NULL) 571 { 572 while (n--) 573 *p++ = c; 574 } 576 575 return s; 577 576 } … … 1673 1672 fd = aud_open_noatime (FIL__, __LINE__, priv, filename, 1674 1673 O_RDONLY|O_NONBLOCK, 0, &o_noatime); 1674 /* 1675 1675 if (fd >= 0) { 1676 1676 sflags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0); 1677 1677 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags & ~O_NONBLOCK); 1678 1678 } 1679 */ 1679 1680 if (fd < 0) 1680 1681 SL_IRETURN(SL_EBADFILE, _("sl_open_file")); … … 2081 2082 } 2082 2083 2084 int sl_read_timeout_prep (SL_TICKET ticket) 2085 { 2086 int fd; 2087 int sflags; 2088 2089 SL_ENTER(_("sl_read_timeout_prep")); 2090 2091 if (SL_ISERROR(fd = get_the_fd(ticket))) 2092 { 2093 TPT(( 0, FIL__, __LINE__, _("msg=<ticket error> errno=<%d>"), fd)); 2094 SL_IRETURN(fd, _("sl_read_timeout_prep")); 2095 } 2096 2097 /* set to non-blocking mode 2098 */ 2099 sflags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0); 2100 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags | O_NONBLOCK); 2101 2102 SL_IRETURN(SL_ENONE, _("sl_read_timeout_prep")); 2103 } 2104 2083 2105 2084 2106 int sl_read_timeout (SL_TICKET ticket, void * buf_in, size_t count, … … 2087 2109 fd_set readfds; 2088 2110 struct timeval tv; 2089 int sflags;2111 /* int sflags; */ 2090 2112 int retval; 2091 2113 … … 2100 2122 extern volatile int sig_termfast; 2101 2123 2102 if (count < 1) 2103 { 2104 TPT(( 0, FIL__, __LINE__, _("msg=<range error>"))); 2105 return(SL_ERANGE); 2106 } 2107 if (buf_in == NULL) 2108 { 2109 TPT(( 0, FIL__, __LINE__, _("msg=<null buffer>"))); 2110 return (SL_ENULL); 2111 } 2112 2113 if (SL_ISERROR(fd = get_the_fd(ticket))) 2114 { 2115 TPT(( 0, FIL__, __LINE__, _("msg=<ticket error> errno=<%d>"), fd)); 2116 return (fd); 2124 if (buf_in == NULL || SL_ISERROR(fd = get_the_fd(ticket))) 2125 { 2126 if (buf_in == NULL) 2127 { 2128 TPT(( 0, FIL__, __LINE__, _("msg=<null buffer>"))); 2129 return (SL_ENULL); 2130 } 2131 if (SL_ISERROR(fd = get_the_fd(ticket))) 2132 { 2133 TPT(( 0, FIL__, __LINE__, _("msg=<ticket error> errno=<%d>"), fd)); 2134 return (fd); 2135 } 2117 2136 } 2118 2137 2119 2138 buf = (char *) buf_in; 2120 2121 /* set to non-blocking mode2122 */2123 sflags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);2124 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags | O_NONBLOCK);2125 2139 2126 2140 tstart = time(NULL); … … 2129 2143 while (count > 0) 2130 2144 { 2131 2132 if (sig_termfast == 1)2133 {2134 retry_fcntl(FIL__, __LINE__, fd, F_SETFL,2135 sflags & ~O_NONBLOCK);2136 return (SL_EREAD);2137 }2138 2139 2145 FD_ZERO(&readfds); 2140 2146 FD_SET(fd, &readfds); 2141 2142 if (tdiff >= timeout)2143 {2144 retry_fcntl(FIL__, __LINE__, fd, F_SETFL,2145 sflags & ~O_NONBLOCK);2146 return (SL_TIMEOUT);2147 }2148 2149 /*2150 tnow = time(NULL);2151 tdiff = tnow - tstart;2152 */2153 2147 2154 2148 tv.tv_sec = timeout - tdiff; … … 2160 2154 { 2161 2155 byteread = read (fd, buf, count); 2162 if (byteread != -1 && byteread != 0) 2156 2157 if (byteread > 0) 2163 2158 { 2164 2159 bytes += byteread; count -= byteread; … … 2182 2177 else 2183 2178 { 2184 retry_fcntl(FIL__, __LINE__, fd, F_SETFL,2185 sflags & ~O_NONBLOCK);2186 2179 return (SL_EREAD); 2187 2180 } … … 2197 2190 else if (retval == 0) 2198 2191 { 2199 retry_fcntl(FIL__, __LINE__, fd, F_SETFL,2200 sflags & ~O_NONBLOCK);2201 2192 return (SL_TIMEOUT); 2202 2193 } 2203 2194 else 2204 2195 { 2205 retry_fcntl(FIL__, __LINE__, fd, F_SETFL,2206 sflags & ~O_NONBLOCK);2207 2196 return (SL_EREAD); 2208 2197 } 2198 2199 if (sig_termfast == 1) 2200 { 2201 return (SL_EREAD); 2202 } 2203 2209 2204 tnow = time(NULL); 2210 2205 tdiff = tnow - tstart; 2211 } 2212 2213 retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags & ~O_NONBLOCK); 2206 2207 if (tdiff > timeout) 2208 { 2209 return (SL_TIMEOUT); 2210 } 2211 } 2212 2214 2213 return ((int) bytes); 2215 2214 }
Note:
See TracChangeset
for help on using the changeset viewer.