svn commit: r217541 - user/nwhitehorn/bsdinstall/partedit
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Tue Jan 18 15:49:02 UTC 2011
Author: nwhitehorn
Date: Tue Jan 18 15:49:01 2011
New Revision: 217541
URL: http://svn.freebsd.org/changeset/base/217541
Log:
Finish modifications to allow this to be used as a replacement for sade(8).
Modified:
user/nwhitehorn/bsdinstall/partedit/partedit.c
Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c
==============================================================================
--- user/nwhitehorn/bsdinstall/partedit/partedit.c Tue Jan 18 15:46:04 2011 (r217540)
+++ user/nwhitehorn/bsdinstall/partedit/partedit.c Tue Jan 18 15:49:01 2011 (r217541)
@@ -204,6 +204,7 @@ apply_changes(struct gmesh *mesh)
char message[512];
int i, nitems, error;
const char **items;
+ const char *fstab_path;
FILE *fstab;
nitems = 1; /* Partition table changes */
@@ -259,7 +260,11 @@ apply_changes(struct gmesh *mesh)
free(__DECONST(char *, items[i*2]));
free(items);
- fstab = fopen(getenv("PATH_FSTAB"), "w+");
+ if (getenv("PATH_FSTAB") != NULL)
+ fstab_path = getenv("PATH_FSTAB");
+ else
+ fstab_path = "/etc/fstab";
+ fstab = fopen(fstab_path, "w+");
if (fstab == NULL) {
sprintf(message, "Cannot open fstab file %s for writing (%s)\n",
getenv("PATH_FSTAB"), strerror(errno));
More information about the svn-src-user
mailing list