Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- Location:
- branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/Kbuild
r1765 r2725 1 # DO NOT EDIT. This file is generated from Kbuild.src 1 2 # Makefile for busybox 2 3 # 3 4 # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org> 4 5 # 5 # Licensed under the GPL v2, see the file LICENSE in this tarball.6 # Licensed under GPLv2, see file LICENSE in this source tree. 6 7 7 8 NEEDED-$(CONFIG_E2FSCK) = y … … 11 12 12 13 lib-y:= 14 15 16 13 17 lib-$(NEEDED-y) += cache.o dev.o devname.o devno.o blkid_getsize.o \ 14 18 probe.o read.o resolve.o save.o tag.o list.o -
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/blkid.h
r1765 r2725 11 11 * %End-Header% 12 12 */ 13 14 #ifndef _BLKID_BLKID_H 15 #define _BLKID_BLKID_H 13 #ifndef BLKID_BLKID_H 14 #define BLKID_BLKID_H 1 16 15 17 16 #include <sys/types.h> … … 103 102 #endif 104 103 105 #endif /* _BLKID_BLKID_H */104 #endif -
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/blkidP.h
r1765 r2725 11 11 * %End-Header% 12 12 */ 13 14 #ifndef _BLKID_BLKIDP_H 15 #define _BLKID_BLKIDP_H 13 #ifndef BLKID_BLKIDP_H 14 #define BLKID_BLKIDP_H 1 16 15 17 16 #include <sys/types.h> … … 185 184 #endif 186 185 187 #endif /* _BLKID_BLKIDP_H */186 #endif -
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/cache.c
r1765 r2725 36 36 filename ? filename : "default cache")); 37 37 38 if (!(cache = (blkid_cache) calloc(1, sizeof(struct blkid_struct_cache)))) 39 return -BLKID_ERR_MEM; 38 cache = xzalloc(sizeof(struct blkid_struct_cache)); 40 39 41 40 INIT_LIST_HEAD(&cache->bic_devs); -
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/dev.c
r1765 r2725 21 21 blkid_dev dev; 22 22 23 if (!(dev = (blkid_dev) calloc(1, sizeof(struct blkid_struct_dev)))) 24 return NULL; 23 dev = xzalloc(sizeof(struct blkid_struct_dev)); 25 24 26 25 INIT_LIST_HEAD(&dev->bid_devs); … … 83 82 printf(" tag: NULL\n"); 84 83 } 85 puts("");84 bb_putchar('\n'); 86 85 } 87 86 #endif … … 162 161 { 163 162 blkid_dev_iterate iter; 164 blkid_cache 163 blkid_cache cache = NULL; 165 164 blkid_dev dev; 166 165 int c, ret; -
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/devname.c
r1765 r2725 153 153 154 154 DBG(DEBUG_DEVNAME, printf("opening %s\n", lvm_device)); 155 if ((lvf = fopen (lvm_device, "r")) == NULL) {155 if ((lvf = fopen_for_read(lvm_device)) == NULL) { 156 156 DBG(DEBUG_DEVNAME, printf("%s: (%d) %s\n", lvm_device, errno, 157 157 strerror(errno))); … … 234 234 char device[110]; 235 235 236 procpt = fopen (PROC_EVMS_VOLUMES, "r");236 procpt = fopen_for_read(PROC_EVMS_VOLUMES); 237 237 if (!procpt) 238 238 return 0; 239 239 while (fgets(line, sizeof(line), procpt)) { 240 if (sscanf 240 if (sscanf(line, " %d %d %d %*s %*s %[^\n ]", 241 241 &ma, &mi, &sz, device) != 4) 242 242 continue; … … 259 259 FILE *proc; 260 260 char line[1024]; 261 char ptname0[128], ptname1[128], *ptname = 0;261 char ptname0[128], ptname1[128], *ptname = NULL; 262 262 char *ptnames[2]; 263 263 dev_t devs[2]; … … 274 274 275 275 if (cache->bic_flags & BLKID_BIC_FL_PROBED && 276 time( 0) - cache->bic_time < BLKID_PROBE_INTERVAL)276 time(NULL) - cache->bic_time < BLKID_PROBE_INTERVAL) 277 277 return 0; 278 278 … … 283 283 #endif 284 284 285 proc = fopen (PROC_PARTITIONS, "r");285 proc = fopen_for_read(PROC_PARTITIONS); 286 286 if (!proc) 287 287 return -BLKID_ERR_PROC; … … 336 336 fclose(proc); 337 337 338 cache->bic_time = time( 0);338 cache->bic_time = time(NULL); 339 339 cache->bic_flags |= BLKID_BIC_FL_PROBED; 340 340 blkid_flush_cache(cache); -
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/list.h
r1765 r2725 1 1 /* vi: set sw=4 ts=4: */ 2 2 #if !defined(_BLKID_LIST_H) && !defined(LIST_HEAD) 3 #define _BLKID_LIST_H3 #define BLKID_LIST_H 1 4 4 5 5 #ifdef __cplusplus … … 71 71 #endif 72 72 73 #endif /* _BLKID_LIST_H */73 #endif -
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/probe.c
r1765 r2725 83 83 { 84 84 struct ext2_super_block *es = (struct ext2_super_block *) buf; 85 const char *label = 0;85 const char *label = NULL; 86 86 87 87 DBG(DEBUG_PROBE, printf("ext2_sb.compat = %08X:%08X:%08X\n", … … 169 169 struct vfat_super_block *vs; 170 170 char serno[10]; 171 const char *label = 0;171 const char *label = NULL; 172 172 int label_len = 0; 173 173 … … 202 202 struct msdos_super_block *ms = (struct msdos_super_block *) buf; 203 203 char serno[10]; 204 const char *label = 0;204 const char *label = NULL; 205 205 int label_len = 0; 206 206 … … 233 233 { 234 234 struct xfs_super_block *xs; 235 const char *label = 0;235 const char *label = NULL; 236 236 237 237 xs = (struct xfs_super_block *)buf; … … 251 251 struct reiserfs_super_block *rs = (struct reiserfs_super_block *) buf; 252 252 unsigned int blocksize; 253 const char *label = 0;253 const char *label = NULL; 254 254 255 255 blocksize = blkid_le16(rs->rs_blocksize); … … 278 278 { 279 279 struct jfs_super_block *js; 280 const char *label = 0;280 const char *label = NULL; 281 281 282 282 js = (struct jfs_super_block *)buf; … … 296 296 { 297 297 struct romfs_super_block *ros; 298 const char *label = 0;298 const char *label = NULL; 299 299 300 300 ros = (struct romfs_super_block *)buf; … … 313 313 { 314 314 struct cramfs_super_block *csb; 315 const char *label = 0;315 const char *label = NULL; 316 316 317 317 csb = (struct cramfs_super_block *)buf; … … 430 430 major = ocfsmajor(ovh); 431 431 if (major == 1) 432 blkid_set_tag(dev, "SEC_TYPE","ocfs1",sizeof("ocfs1"));432 blkid_set_tag(dev, "SEC_TYPE", "ocfs1", sizeof("ocfs1")); 433 433 else if (major >= 9) 434 blkid_set_tag(dev, "SEC_TYPE","ntocfs",sizeof("ntocfs"));434 blkid_set_tag(dev, "SEC_TYPE", "ntocfs", sizeof("ntocfs")); 435 435 436 436 blkid_set_tag(dev, "LABEL", (const char*)ovl.label, ocfslabellen(ovl)); … … 563 563 return NULL; 564 564 565 now = time( 0);565 now = time(NULL); 566 566 diff = now - dev->bid_time; 567 567 … … 660 660 if (dev && type) { 661 661 dev->bid_devno = st.st_rdev; 662 dev->bid_time = time( 0);662 dev->bid_time = time(NULL); 663 663 dev->bid_flags |= BLKID_BID_FL_VERIFIED; 664 664 cache->bic_flags |= BLKID_BIC_FL_CHANGED; -
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/probe.h
r1765 r2725 12 12 * %End-Header% 13 13 */ 14 15 #ifndef _BLKID_PROBE_H 16 #define _BLKID_PROBE_H 14 #ifndef BLKID_PROBE_H 15 #define BLKID_PROBE_H 1 17 16 18 17 #include <linux/types.h> … … 309 308 __asm__("bswap %0" : "=r" (val) : "0" (val)); 310 309 #else 311 __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes 312 "rorl $16,%0\n\t" /* swap words 313 "xchgb %b0,%h0" /* swap higher bytes 310 __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */ 311 "rorl $16,%0\n\t" /* swap words */ 312 "xchgb %b0,%h0" /* swap higher bytes */ 314 313 :"=q" (val) 315 314 : "0" (val)); … … 320 319 _INLINE_ __u16 blkid_swab16(__u16 val) 321 320 { 322 __asm__("xchgb %b0,%h0" /* swap bytes */ \323 : "=q" (val) \324 : "0" (val)); \321 __asm__("xchgb %b0,%h0" /* swap bytes */ 322 : "=q" (val) 323 : "0" (val)); 325 324 return val; 326 325 } -
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/read.c
r1765 r2725 375 375 cache->bic_filename)); 376 376 377 file = fdopen(fd, "r"); 378 if (!file) 379 goto errout; 377 file = xfdopen_for_read(fd); 380 378 381 379 while (fgets(buf, sizeof(buf), file)) { … … 437 435 printf(" tag: NULL\n"); 438 436 } 439 puts("");437 bb_putchar('\n'); 440 438 } 441 439 -
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/resolve.c
r1765 r2725 66 66 blkid_dev dev; 67 67 blkid_cache c = cache; 68 char *t = 0, *v = 0;68 char *t = NULL, *v = NULL; 69 69 char *ret = NULL; 70 70 … … 122 122 } 123 123 if (blkid_get_cache(&cache, bb_dev_null) < 0) { 124 fprintf(stderr, " cannot get blkid cache\n");124 fprintf(stderr, "Can't get blkid cache\n"); 125 125 exit(1); 126 126 } -
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/save.c
r1765 r2725 96 96 fd = mkstemp(tmp); 97 97 if (fd >= 0) { 98 file = fdopen(fd, "w");98 file = xfdopen_for_write(fd); 99 99 opened = tmp; 100 100 } … … 103 103 104 104 if (!file) { 105 file = fopen (filename, "w");105 file = fopen_for_write(filename); 106 106 opened = filename; 107 107 } -
branches/2.2.9/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/tag.c
r1765 r2725 22 22 blkid_tag tag; 23 23 24 if (!(tag = (blkid_tag) calloc(1, sizeof(struct blkid_struct_tag)))) 25 return NULL; 24 tag = xzalloc(sizeof(struct blkid_struct_tag)); 26 25 27 26 INIT_LIST_HEAD(&tag->bit_tags); … … 114 113 { 115 114 blkid_tag t = 0, head = 0; 116 char *val = 0;115 char *val = NULL; 117 116 118 117 if (!dev || !name) … … 365 364 { 366 365 blkid_tag_iterate iter; 367 blkid_cache 366 blkid_cache cache = NULL; 368 367 blkid_dev dev; 369 368 int c, ret, found;
Note:
See TracChangeset
for help on using the changeset viewer.