mount.c (d5f6aa5f2476723f1e2d96506931951f29af7d71) mount.c (b6cf6bb275df72fcf49d9816a0946a1eda53c845)
1/*
2 * Copyright (c) 1980, 1989, 1993, 1994
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

--- 313 unchanged lines hidden (view full) ---

322 warn("vfork");
323 free(optbuf);
324 return (1);
325 case 0: /* Child. */
326 if (strcmp(vfstype, "ufs") == 0)
327 exit(mount_ufs(argc, (char * const *) argv));
328
329 /* Go find an executable. */
1/*
2 * Copyright (c) 1980, 1989, 1993, 1994
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

--- 313 unchanged lines hidden (view full) ---

322 warn("vfork");
323 free(optbuf);
324 return (1);
325 case 0: /* Child. */
326 if (strcmp(vfstype, "ufs") == 0)
327 exit(mount_ufs(argc, (char * const *) argv));
328
329 /* Go find an executable. */
330 edir = edirs;
331 do {
330 for (edir = edirs; *edir; edir++) {
332 (void)snprintf(execname,
333 sizeof(execname), "%s/mount_%s", *edir, vfstype);
334 execv(execname, (char * const *)argv);
331 (void)snprintf(execname,
332 sizeof(execname), "%s/mount_%s", *edir, vfstype);
333 execv(execname, (char * const *)argv);
335 warn("exec %s for %s", execname, name);
336 } while (*++edir != NULL);
334 }
335 if (errno == ENOENT) {
336 int len = 0;
337 char *cp;
338 for (edir = edirs; *edir; edir++)
339 len += strlen(*edir) + 2; /* ", " */
340 if ((cp = malloc(len)) == NULL) {
341 warn(NULL);
342 exit(1);
343 }
344 cp[0] = '\0';
345 for (edir = edirs; *edir; edir++) {
346 strcat(cp, *edir);
347 if (edir[1] != NULL)
348 strcat(cp, ", ");
349 }
350 warn("exec mount_%s not found in %s", vfstype, cp);
351 }
337 exit(1);
338 /* NOTREACHED */
339 default: /* Parent. */
340 free(optbuf);
341
342 if (waitpid(pid, &status, 0) < 0) {
343 warn("waitpid");
344 return (1);

--- 179 unchanged lines hidden ---
352 exit(1);
353 /* NOTREACHED */
354 default: /* Parent. */
355 free(optbuf);
356
357 if (waitpid(pid, &status, 0) < 0) {
358 warn("waitpid");
359 return (1);

--- 179 unchanged lines hidden ---