Changeset 1117 in kBuild for trunk/src/kmk/kmkbuiltin/cmp_special.c
- Timestamp:
- Sep 25, 2007 5:03:31 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/cmp_special.c
-
Property svn:eol-style
set to
native
r1115 r1117 30 30 */ 31 31 32 #include <sys/cdefs.h> 32 /*#include <sys/cdefs.h>*/ 33 33 #ifndef lint 34 #if 034 /*#if 0 35 35 static char sccsid[] = "@(#)special.c 8.3 (Berkeley) 4/2/94"; 36 36 #else 37 37 __RCSID("$NetBSD: special.c,v 1.12 2007/08/21 14:09:54 christos Exp $"); 38 #endif 38 #endif*/ 39 39 #endif /* not lint */ 40 40 41 41 #include <sys/types.h> 42 42 43 #include <err.h>43 #include "err.h" 44 44 #include <stdlib.h> 45 45 #include <stdio.h> 46 46 #include <string.h> 47 47 48 #include " extern.h"48 #include "cmp_extern.h" 49 49 50 void 50 static int 51 51 c_special(int fd1, char *file1, off_t skip1, int fd2, char *file2, off_t skip2) 52 52 { … … 58 58 dfound = 0; 59 59 if ((fp1 = fdopen(fd1, "r")) == NULL) 60 err(ERR_EXIT, "%s", file1);60 return err(ERR_EXIT, "%s", file1); 61 61 if ((fp2 = fdopen(fd2, "r")) == NULL) 62 err(ERR_EXIT, "%s", file2);62 return err(ERR_EXIT, "%s", file2); 63 63 64 64 for (byte = line = 1; skip1--; byte++) { … … 88 88 ch1, ch2); 89 89 } else 90 diffmsg(file1, file2, byte, line); 91 /* NOTREACHED */ 90 return diffmsg(file1, file2, byte, line); 92 91 } 93 92 if (ch1 == '\n') … … 97 96 eof: 98 97 if (ferror(fp1)) 99 errmsg(file1, byte, line);98 return errmsg(file1, byte, line); 100 99 if (ferror(fp2)) 101 errmsg(file2, byte, line);100 return errmsg(file2, byte, line); 102 101 if (feof(fp1)) { 103 102 if (!feof(fp2)) 104 eofmsg(file1, byte, line);103 return eofmsg(file1, byte, line); 105 104 } else 106 105 if (feof(fp2)) 107 eofmsg(file2, byte, line);106 return eofmsg(file2, byte, line); 108 107 (void)fclose(fp1); 109 108 (void)fclose(fp2); 110 109 if (dfound) 111 exit(DIFF_EXIT); 110 return(DIFF_EXIT); 111 return(0); 112 112 } -
Property svn:eol-style
set to
Note:
See TracChangeset
for help on using the changeset viewer.