if (line_read && *line_read) {
add_history(line_read);
}
-#endif
+#endif /* HAVE_READLINE_HISTORY */
free(line_read);
if (return_code == QUIT_CMD || return_code == ERR) {
main(int argc, char **argv)
{
int return_code = 0;
- int fd = (-1);
+ int fd = (-1); /* fd == -1 means connection to fcron is not currently open */
struct passwd *pass = NULL;
rootuid = get_user_uid_safe(ROOTNAME);
}
xclose_check(&to_fd, dest);
- to_fd = -1;
if (rename_as_user(tmp_filename_str, dest, useruid, fcrontab_gid) < 0) {
error_e("Unable to rename %s to %s : old source file kept",
void
reinstall(char *fcron_orig)
{
- int i = 0;
+ int i = -1;
explain("reinstalling %s's fcrontab", user);
/* close the connection, remove it from the list
and make client points to the next entry */
{
+ debug("closing connection : fd : %d", (*client)->fcl_sock_fd);
shutdown((*client)->fcl_sock_fd, SHUT_RDWR);
- xclose_check(&((*client)->fcl_sock_fd), "client fd");
remove_from_select_set((*client)->fcl_sock_fd, &master_set, &set_max_fd);
- debug("connection closed : fd : %d", (*client)->fcl_sock_fd);
+ xclose_check(&((*client)->fcl_sock_fd), "client fd");
if (prev_client == NULL) {
fcrondyn_cl_base = (*client)->fcl_next;
Free_safe((*client)->fcl_user);