/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.tizenopensource.org/license
+ * http://floralicense.org/license/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
int ret;
struct timeval tv;
- if (!s_info.fp)
+ if (!s_info.fp) {
return LB_STATUS_ERROR_IO;
+ }
gettimeofday(&tv, NULL);
fprintf(s_info.fp, "%d %lu.%lu [%s:%d] ", getpid(), tv.tv_sec, tv.tv_usec, util_basename((char *)func), line);
if (filename) {
snprintf(filename, namelen, "%s/%d_%s", SLAVE_LOG_PATH, s_info.file_id, s_info.filename);
- if (s_info.fp)
- fclose(s_info.fp);
+ if (s_info.fp) {
+ if (fclose(s_info.fp) != 0) {
+ ErrPrint("fclose: %s\n", strerror(errno));
+ }
+ }
s_info.fp = fopen(filename, "w+");
- if (!s_info.fp)
+ if (!s_info.fp) {
ErrPrint("Failed to open a file: %s\n", filename);
+ }
free(filename);
}
int namelen;
char *filename;
- if (s_info.fp)
+ if (s_info.fp) {
return 0;
+ }
s_info.filename = strdup(name);
if (!s_info.filename) {
}
if (s_info.fp) {
- fclose(s_info.fp);
+ if (fclose(s_info.fp) != 0) {
+ ErrPrint("fclose: %s\n", strerror(errno));
+ }
s_info.fp = NULL;
}