(doit): print an error and bail out if storing an entry in the

database fails.  The most likely reason for it failing is
out-of-space.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9447 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2001-01-04 15:59:26 +00:00
parent a5da59119d
commit 3ea518adb5

View File

@@ -340,7 +340,9 @@ doit(const char *filename, int merge)
return 1;
}
line = 0;
while(fgets(s, sizeof(s), f)){
ret = 0;
while(fgets(s, sizeof(s), f) != NULL) {
ret = 0;
line++;
e.principal = s;
for(p = s; *p; p++){
@@ -461,12 +463,16 @@ doit(const char *filename, int merge)
}
#endif
db->store(context, db, HDB_F_REPLACE, &ent);
ret = db->store(context, db, HDB_F_REPLACE, &ent);
hdb_free_entry (context, &ent);
if (ret) {
krb5_warn(context, ret, "db_store");
break;
}
}
db->close(context, db);
fclose(f);
return 0;
return ret != 0;
}