Deleted Added
full compact
ufs.c (9202) ufs.c (12661)
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last attempt in the `sysinstall' line, the next
5 * generation being slated to essentially a complete rewrite.
6 *
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last attempt in the `sysinstall' line, the next
5 * generation being slated to essentially a complete rewrite.
6 *
7 * $Id: ufs.c,v 1.4.2.2 1995/06/05 12:04:09 jkh Exp $
7 * $Id: ufs.c,v 1.5.2.4 1995/10/22 01:33:02 jkh Exp $
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 * Copyright (c) 1995
12 * Gary J Palmer. All rights reserved.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions

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

45
46#include "sysinstall.h"
47#include <sys/fcntl.h>
48#include <sys/param.h>
49
50/* No init or shutdown routines necessary - all done in mediaSetUFS() */
51
52int
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 * Copyright (c) 1995
12 * Gary J Palmer. All rights reserved.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions

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

45
46#include "sysinstall.h"
47#include <sys/fcntl.h>
48#include <sys/param.h>
49
50/* No init or shutdown routines necessary - all done in mediaSetUFS() */
51
52int
53mediaGetUFS(Device *dev, char *file, Attribs *dist_attrs)
53mediaGetUFS(Device *dev, char *file, Boolean tentative)
54{
55 char buf[PATH_MAX];
56
54{
55 char buf[PATH_MAX];
56
57 msgDebug("Request for %s from UFS\n", file);
57 snprintf(buf, PATH_MAX, "%s/%s", dev->private, file);
58 snprintf(buf, PATH_MAX, "%s/%s", dev->private, file);
58 if (!access(buf, R_OK))
59 if (file_readable(buf))
59 return open(buf, O_RDONLY);
60 snprintf(buf, PATH_MAX, "%s/dists/%s", dev->private, file);
60 return open(buf, O_RDONLY);
61 snprintf(buf, PATH_MAX, "%s/dists/%s", dev->private, file);
62 if (file_readable(buf))
63 return open(buf, O_RDONLY);
64 snprintf(buf, PATH_MAX, "%s/%s/%s", dev->private, variable_get(VAR_RELNAME), file);
65 if (file_readable(buf))
66 return open(buf, O_RDONLY);
67 snprintf(buf, PATH_MAX, "%s/%s/dists/%s", dev->private, variable_get(VAR_RELNAME), file);
61 return open(buf, O_RDONLY);
62}
68 return open(buf, O_RDONLY);
69}