1/* 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static const char sccsid[] = "@(#)utilities.c 8.6 (Berkeley) 5/19/95"; 37#endif 38static const char rcsid[] = |
39 "$FreeBSD: head/sbin/fsck_ffs/fsutil.c 75927 2001-04-24 22:38:08Z mckusick $"; |
40#endif /* not lint */ 41 42#include <sys/param.h> 43#include <sys/types.h> 44#include <sys/stat.h> 45 46#include <ufs/ufs/dinode.h> 47#include <ufs/ufs/dir.h> --- 211 unchanged lines hidden (view full) --- 259} 260 261void 262rwerror(mesg, blk) 263 char *mesg; 264 ufs_daddr_t blk; 265{ 266 |
267 if (bkgrdcheck) 268 exit(EEXIT); |
269 if (preen == 0) 270 printf("\n"); 271 pfatal("CANNOT %s: %ld", mesg, blk); 272 if (reply("CONTINUE") == 0) 273 exit(EEXIT); 274} 275 276void --- 365 unchanged lines hidden (view full) --- 642{ 643 va_list ap; 644#if __STDC__ 645 va_start(ap, fmt); 646#else 647 va_start(ap); 648#endif 649 if (!preen) { |
650 (void)vfprintf(stdout, fmt, ap); |
651 va_end(ap); 652 if (usedsoftdep) |
653 (void)fprintf(stdout, |
654 "\nUNEXPECTED SOFT UPDATE INCONSISTENCY\n"); 655 /* 656 * Force foreground fsck to clean up inconsistency. 657 */ 658 if (bkgrdflag) { 659 cmd.value = FS_NEEDSFSCK; 660 cmd.size = 1; 661 if (sysctlbyname("vfs.ffs.setflags", 0, 0, 662 &cmd, sizeof cmd) == -1) 663 pwarn("CANNOT SET FS_NEEDSFSCK FLAG\n"); |
664 fprintf(stdout, "CANNOT RUN IN BACKGROUND\n"); |
665 ckfini(0); 666 exit(EEXIT); 667 } 668 return; 669 } 670 if (cdevname == NULL) 671 cdevname = "fsck"; |
672 (void)fprintf(stdout, "%s: ", cdevname); 673 (void)vfprintf(stdout, fmt, ap); 674 (void)fprintf(stdout, |
675 "\n%s: UNEXPECTED%sINCONSISTENCY; RUN fsck MANUALLY.\n", 676 cdevname, usedsoftdep ? " SOFT UPDATE " : " "); 677 /* 678 * Force foreground fsck to clean up inconsistency. 679 */ 680 if (bkgrdflag) { 681 cmd.value = FS_NEEDSFSCK; 682 cmd.size = 1; --- 20 unchanged lines hidden (view full) --- 703{ 704 va_list ap; 705#if __STDC__ 706 va_start(ap, fmt); 707#else 708 va_start(ap); 709#endif 710 if (preen) |
711 (void)fprintf(stdout, "%s: ", cdevname); 712 (void)vfprintf(stdout, fmt, ap); |
713 va_end(ap); 714} 715 716/* 717 * Stub for routines from kernel. 718 */ 719void 720#if __STDC__ --- 6 unchanged lines hidden (view full) --- 727{ 728 va_list ap; 729#if __STDC__ 730 va_start(ap, fmt); 731#else 732 va_start(ap); 733#endif 734 pfatal("INTERNAL INCONSISTENCY:"); |
735 (void)vfprintf(stdout, fmt, ap); |
736 va_end(ap); 737 exit(EEXIT); 738} |