* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
sprintf(filepnm, "%s/mountdata", tmpdir);
filep = fopen(filepnm, "r");
if (filep) {
+ size_t num_read;
vprint("Reading %s\n", MOUNT_DATA_FILE);
- fread(mo_ldd, sizeof(*mo_ldd), 1, filep);
+ num_read = fread(mo_ldd, sizeof(*mo_ldd), 1, filep);
+ if (num_read < 1 && ferror(filep)) {
+ fprintf(stderr, "%s: Unable to read from file (%s): %s\n",
+ progname, filepnm, strerror(errno));
+ goto out_close;
+ }
} else {
verrprint("%s: Unable to read %d.%d config %s.\n",
progname, LUSTRE_MAJOR, LUSTRE_MINOR, filepnm);
- goto out_close;
+ ret = 1;
+ goto out_rmdir;
}
out_close: