Ticket #18502: patch-utils.c.diff
File patch-utils.c.diff, 971 bytes (added by 0xffea@…, 16 years ago) |
---|
-
utils.c
old new 18 18 19 19 #define _XOPEN_SOURCE 600 20 20 #define __USE_XOPEN2K 21 #define _DARWIN_C_SOURCE 21 22 #include <stdio.h> 22 23 #include <stdlib.h> 23 24 #ifndef __CHECKER__ … … 30 31 #include <dirent.h> 31 32 #include <fcntl.h> 32 33 #include <unistd.h> 34 #ifdef __APPLE__ 35 #include <sys/disk.h> 36 #else 33 37 #include <mntent.h> 38 #endif 39 40 34 41 #include "kerncompat.h" 35 42 #include "radix-tree.h" 36 43 #include "ctree.h" … … 393 400 if (!S_ISBLK(st->st_mode)) { 394 401 return 0; 395 402 } 403 #ifdef __APPLE__ 404 if (ioctl(fd, DKIOCGETBLOCKCOUNT, &size) >= 0) { 405 #else 396 406 if (ioctl(fd, BLKGETSIZE64, &size) >= 0) { 407 #endif 397 408 return size; 398 409 } 399 410 return 0; … … 594 605 */ 595 606 int check_mounted(char *file) 596 607 { 608 #ifdef __APPLE__ 609 return 0; 610 #else 597 611 struct mntent *mnt; 598 612 struct stat st_buf; 599 613 dev_t file_dev = 0; … … 638 652 639 653 endmntent (f); 640 654 return ret; 655 #endif 641 656 } 642 657 643 658 struct pending_dir {