Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*
* Append data to the config file in file_path
*/
*
* Append data to the config file in file_path
*/
-static void write_config(char *file_path, size_t size, char *data)
+static int write_config(char *file_path, size_t size, char *data)
+ size_t len;
+ int ret = 0;
fp = open_config(file_path, "a");
if (fp == NULL) {
fp = open_config(file_path, "a");
if (fp == NULL) {
}
/* Write session name into config file */
}
/* Write session name into config file */
- fwrite(data, size, 1, fp);
+ len = fwrite(data, size, 1, fp);
+ if (len < 1) {
+ ret = -1;
+ }
if (ret < 0) {
goto error;
}
if (ret < 0) {
goto error;
}
-
- write_config(path, ret, session_name);
- ret = 0;
-
+ ret = write_config(path, ret, session_name);