fgui: check if fd is valid before entering new key

This commit is contained in:
ppatience0 2013-06-01 19:40:38 -04:00
parent d3773c4355
commit e1bc28d1dd

View file

@ -792,10 +792,12 @@ needkey(Request *r)
entry[i].a->type = AttrNameval;
}
/* enter the new key !!!!need to do something in case of error!!!! */
/* enter the new key */
fd = open("/mnt/factotum/ctl", OWRITE);
fprint(fd, "key %A", r->a);
close(fd);
if(fd >= 0){
fprint(fd, "key %A", r->a);
close(fd);
}
teardownneedkey(r);
out: