summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
27e4eaf)
Both the server and the afs process need to access the lopsub parse
result which is allocated and initialized prior to the fork(2) that
creates the afs process. Hence both processes should free this memory
on exit.
The new public free_lpr() frees the memory allocated by both parse result
structures.
out_close:
close_afs_tables();
out:
out_close:
close_afs_tables();
out:
if (ret < 0)
PARA_EMERG_LOG("%s\n", para_strerror(-ret));
exit(EXIT_FAILURE);
if (ret < 0)
PARA_EMERG_LOG("%s\n", para_strerror(-ret));
exit(EXIT_FAILURE);
+/**
+ * Deallocate all lopsub parse results.
+ *
+ * The server allocates a parse result for command line options and optionally
+ * a second parse result for the effective configuration, defined by merging
+ * the command line options with the options stored in the configuration file.
+ * This function frees both structures.
+ */
+void free_lpr(void)
+{
+ lls_free_parse_result(server_lpr, CMD_PTR);
+ if (server_lpr != cmdline_lpr)
+ lls_free_parse_result(cmdline_lpr, CMD_PTR);
+}
+
/**
* The main function of para_server.
*
/**
* The main function of para_server.
*
vss_shutdown();
shm_detach(mmd);
user_list_deplete();
vss_shutdown();
shm_detach(mmd);
user_list_deplete();
- lls_free_parse_result(server_lpr, CMD_PTR);
- if (server_lpr != cmdline_lpr)
- lls_free_parse_result(cmdline_lpr, CMD_PTR);
exit(ret < 0? EXIT_FAILURE : EXIT_SUCCESS);
}
exit(ret < 0? EXIT_FAILURE : EXIT_SUCCESS);
}
void parse_config_or_die(bool reload);
char *server_get_tasks(void);
bool process_is_command_handler(void);
void parse_config_or_die(bool reload);
char *server_get_tasks(void);
bool process_is_command_handler(void);