summaryrefslogtreecommitdiffstats
path: root/loader2/modules.c
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2003-06-26 04:32:13 +0000
committerBill Nottingham <notting@redhat.com>2003-06-26 04:32:13 +0000
commit0905e2322f8d967275409f24e10c14dc1caa1f8f (patch)
treef15cd88c33199c663a2169b091431e68cfad0525 /loader2/modules.c
parent8badc885649b2acd865d9d2d09a75d2c89131aab (diff)
downloadanaconda-0905e2322f8d967275409f24e10c14dc1caa1f8f.tar.gz
anaconda-0905e2322f8d967275409f24e10c14dc1caa1f8f.tar.xz
anaconda-0905e2322f8d967275409f24e10c14dc1caa1f8f.zip
be a little more polite if /etc/arch doesn't exist
Diffstat (limited to 'loader2/modules.c')
-rw-r--r--loader2/modules.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/loader2/modules.c b/loader2/modules.c
index 1e6dd17f2..3c343066a 100644
--- a/loader2/modules.c
+++ b/loader2/modules.c
@@ -715,15 +715,18 @@ char * getModuleLocation(int version) {
struct stat sb;
int fd;
- stat(archfile, &sb);
- arch = malloc(sb.st_size + 1);
-
- fd = open(archfile, O_RDONLY);
- read(fd, arch, sb.st_size);
- if (arch[sb.st_size -1 ] == '\n')
- sb.st_size--;
- arch[sb.st_size] = '\0';
- close(fd);
+ if (!stat(archfile, &sb)) {
+ arch = malloc(sb.st_size + 1);
+
+ fd = open(archfile, O_RDONLY);
+ read(fd, arch, sb.st_size);
+ if (arch[sb.st_size -1 ] == '\n')
+ sb.st_size--;
+ arch[sb.st_size] = '\0';
+ close(fd);
+ } else {
+ arch = strdup(u.machine);
+ }
}
if (version == 1) {