comparison src/os/unix/ngx_files.c @ 3164:b1b1775698d5

uniform ngx_directio_on/off() interface with other file functions
author Igor Sysoev <igor@sysoev.ru>
date Fri, 25 Sep 2009 14:17:28 +0000
parents 34cbd6e86218
children 26784c34e8be
comparison
equal deleted inserted replaced
3163:34cbd6e86218 3164:b1b1775698d5
404 int flags; 404 int flags;
405 405
406 flags = fcntl(fd, F_GETFL); 406 flags = fcntl(fd, F_GETFL);
407 407
408 if (flags == -1) { 408 if (flags == -1) {
409 return -1; 409 return NGX_FILE_ERROR;
410 } 410 }
411 411
412 return fcntl(fd, F_SETFL, flags | O_DIRECT); 412 return fcntl(fd, F_SETFL, flags | O_DIRECT);
413 } 413 }
414 414
419 int flags; 419 int flags;
420 420
421 flags = fcntl(fd, F_GETFL); 421 flags = fcntl(fd, F_GETFL);
422 422
423 if (flags == -1) { 423 if (flags == -1) {
424 return -1; 424 return NGX_FILE_ERROR;
425 } 425 }
426 426
427 return fcntl(fd, F_SETFL, flags & ~O_DIRECT); 427 return fcntl(fd, F_SETFL, flags & ~O_DIRECT);
428 } 428 }
429 429