=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tcfs/Attic/tcfs_getfspath.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/tcfs/Attic/tcfs_getfspath.c 2000/06/19 20:35:47 1.2 --- src/usr.bin/tcfs/Attic/tcfs_getfspath.c 2000/06/19 22:42:28 1.3 *************** *** 1,4 **** ! /* $OpenBSD: tcfs_getfspath.c,v 1.2 2000/06/19 20:35:47 fgsch Exp $ */ /* * Transparent Cryptographic File System (TCFS) for NetBSD --- 1,4 ---- ! /* $OpenBSD: tcfs_getfspath.c,v 1.3 2000/06/19 22:42:28 aaron Exp $ */ /* * Transparent Cryptographic File System (TCFS) for NetBSD *************** *** 20,39 **** #define WHITESPACE " \t\r\n" int ! tcfs_label_getcipher (char *label) { int ciphernum; ! if (tcfs_get_label (label, NULL, &ciphernum)) ! return ciphernum; return (-1); } int ! tcfs_getfspath (char *label2search, char *path) { ! return tcfs_get_label (label2search, path, NULL); } int --- 20,39 ---- #define WHITESPACE " \t\r\n" int ! tcfs_label_getcipher(char *label) { int ciphernum; ! if (tcfs_get_label(label, NULL, &ciphernum)) ! return (ciphernum); return (-1); } int ! tcfs_getfspath(char *label2search, char *path) { ! return (tcfs_get_label(label2search, path, NULL)); } int *************** *** 43,57 **** char *label, *line, *p, *tag, *mountpoint, *cipherfield; int found = 0; ! if ((fp = fopen(_PATH_FSTAB,"r")) == NULL) return (0); ! if ((line = calloc(1024, sizeof(char))) == NULL) goto out; while (!feof(fp) && !found) { p = line; ! fgets (p, 1024, fp); p = p + strspn(p, WHITESPACE); while (!found) { strsep(&p, WHITESPACE); /* device */ --- 43,57 ---- char *label, *line, *p, *tag, *mountpoint, *cipherfield; int found = 0; ! if ((fp = fopen(_PATH_FSTAB, "r")) == NULL) return (0); ! if ((line = (char *)malloc(1024)) == NULL) goto out; while (!feof(fp) && !found) { p = line; ! fgets(p, 1024, fp); p = p + strspn(p, WHITESPACE); while (!found) { strsep(&p, WHITESPACE); /* device */ *************** *** 96,102 **** } free(line); out: ! fclose (fp); return found; } --- 96,102 ---- } free(line); out: ! fclose(fp); return found; }