Replace strerror() by g_strerror()
authorTomas Mlcoch <tmlcoch@redhat.com>
Tue, 5 May 2015 12:21:58 +0000 (14:21 +0200)
committerTomas Mlcoch <tmlcoch@redhat.com>
Tue, 5 May 2015 12:21:58 +0000 (14:21 +0200)
15 files changed:
src/checksum.c
src/compression_wrapper.c
src/createrepo_c.c
src/createrepo_shared.c
src/deltarpms.c
src/dumper_thread.c
src/helpers.c
src/locate_metadata.c
src/mergerepo_c.c
src/misc.c
src/modifyrepo_shared.c
src/parsepkg.c
src/repomd.c
src/sqlite.c
src/sqliterepo_c.c

index e5c655d..98b454d 100644 (file)
@@ -140,7 +140,7 @@ cr_checksum_file(const char *filename,
     f = fopen(filename, "rb");
     if (!f) {
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Cannot open a file: %s", strerror(errno));
+                    "Cannot open a file: %s", g_strerror(errno));
         return NULL;
     }
 
@@ -161,7 +161,7 @@ cr_checksum_file(const char *filename,
         EVP_DigestUpdate(ctx, buf, readed);
     } else {
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Error while reading a file: %s", strerror(errno));
+                    "Error while reading a file: %s", g_strerror(errno));
         EVP_MD_CTX_destroy(ctx);
         fclose(f);
         return NULL;
index 211b2a2..a08aaa6 100644 (file)
@@ -276,7 +276,7 @@ cr_gz_strerror(gzFile f)
     int errnum;
     char *msg = (char *) gzerror(f, &errnum);
     if (errnum == Z_ERRNO)
-        msg = strerror(errno);
+        msg = g_strerror(errno);
     return msg;
 }
 
@@ -355,14 +355,14 @@ cr_sopen(const char *filename,
             file->FILE = (void *) fopen(filename, mode_str);
             if (!file->FILE)
                 g_set_error(err, ERR_DOMAIN, CRE_IO,
-                            "fopen(): %s", strerror(errno));
+                            "fopen(): %s", g_strerror(errno));
             break;
 
         case (CR_CW_GZ_COMPRESSION): // ---------------------------------------
             file->FILE = (void *) gzopen(filename, mode_str);
             if (!file->FILE) {
                 g_set_error(err, ERR_DOMAIN, CRE_GZ,
-                            "gzopen(): %s", strerror(errno));
+                            "gzopen(): %s", g_strerror(errno));
                 break;
             }
 
@@ -384,7 +384,7 @@ cr_sopen(const char *filename,
 
             if (!f) {
                 g_set_error(err, ERR_DOMAIN, CRE_IO,
-                            "fopen(): %s", strerror(errno));
+                            "fopen(): %s", g_strerror(errno));
                 break;
             }
 
@@ -485,7 +485,7 @@ cr_sopen(const char *filename,
             FILE *f = fopen(filename, mode_str);
             if (!f) {
                 g_set_error(err, ERR_DOMAIN, CRE_XZ,
-                            "fopen(): %s", strerror(errno));
+                            "fopen(): %s", g_strerror(errno));
                 lzma_end(&(xz_file->stream));
                 g_free((void *) xz_file);
                 break;
@@ -551,7 +551,7 @@ cr_close(CR_FILE *cr_file, GError **err)
             } else {
                 ret = CRE_IO;
                 g_set_error(err, ERR_DOMAIN, CRE_IO,
-                            "fclose(): %s", strerror(errno));
+                            "fclose(): %s", g_strerror(errno));
             }
             break;
 
@@ -667,7 +667,7 @@ cr_close(CR_FILE *cr_file, GError **err)
                         // Error while writing
                         ret = CRE_XZ;
                         g_set_error(err, ERR_DOMAIN, CRE_XZ,
-                                    "XZ: fwrite() error: %s", strerror(errno));
+                                    "XZ: fwrite() error: %s", g_strerror(errno));
                         break;
                     }
 
@@ -736,7 +736,7 @@ cr_read(CR_FILE *cr_file, void *buffer, unsigned int len, GError **err)
             if ((ret != (int) len) && !feof((FILE *) cr_file->FILE)) {
                 ret = CR_CW_ERR;
                 g_set_error(err, ERR_DOMAIN, CRE_IO,
-                            "fread(): %s", strerror(errno));
+                            "fread(): %s", g_strerror(errno));
             }
             break;
 
@@ -811,7 +811,7 @@ cr_read(CR_FILE *cr_file, void *buffer, unsigned int len, GError **err)
                     if ((lret = fread(xz_file->buffer, 1, XZ_BUFFER_SIZE, xz_file->file)) < 0) {
                         g_debug("%s: XZ: Error while fread", __func__);
                         g_set_error(err, ERR_DOMAIN, CRE_XZ,
-                                    "XZ: fread(): %s", strerror(errno));
+                                    "XZ: fread(): %s", g_strerror(errno));
                         return CR_CW_ERR;   // Error while reading input file
                     } else if (lret == 0) {
                         g_debug("%s: EOF", __func__);
@@ -948,7 +948,7 @@ cr_write(CR_FILE *cr_file, const void *buffer, unsigned int len, GError **err)
             if ((ret = (int) fwrite(buffer, 1, len, (FILE *) cr_file->FILE)) != (int) len) {
                 ret = CR_CW_ERR;
                 g_set_error(err, ERR_DOMAIN, CRE_IO,
-                            "fwrite(): %s", strerror(errno));
+                            "fwrite(): %s", g_strerror(errno));
             }
             break;
 
@@ -1046,7 +1046,7 @@ cr_write(CR_FILE *cr_file, const void *buffer, unsigned int len, GError **err)
                 if ((fwrite(xz_file->buffer, 1, out_len, xz_file->file)) != out_len) {
                     ret = CR_CW_ERR;
                     g_set_error(err, ERR_DOMAIN, CRE_XZ,
-                                "XZ: fwrite(): %s", strerror(errno));
+                                "XZ: fwrite(): %s", g_strerror(errno));
                     break;   // Error while writing
                 }
             }
index 6bd0e82..7d3955c 100644 (file)
@@ -306,7 +306,7 @@ prepare_cache_dir(struct CmdOptions *cmd_options,
         } else {
             g_set_error(err, CREATEREPO_C_ERROR, CRE_BADARG,
                         "cannot use cachedir %s: %s",
-                        cmd_options->checksum_cachedir, strerror(errno));
+                        cmd_options->checksum_cachedir, g_strerror(errno));
             return FALSE;
         }
     }
@@ -441,7 +441,7 @@ main(int argc, char **argv)
         output_pkg_list = fopen(cmd_options->read_pkgs_list, "w");
         if (!output_pkg_list) {
             g_critical("Cannot open \"%s\" for writing: %s",
-                       cmd_options->read_pkgs_list, strerror(errno));
+                       cmd_options->read_pkgs_list, g_strerror(errno));
             exit(EXIT_FAILURE);
         }
     }
@@ -741,19 +741,19 @@ main(int argc, char **argv)
             pri_db_fd = g_mkstemp(pri_db_filename);
             g_debug("%s", pri_db_filename);
             if (pri_db_fd == -1) {
-                g_critical("Cannot open %s: %s", pri_db_filename, strerror(errno));
+                g_critical("Cannot open %s: %s", pri_db_filename, g_strerror(errno));
                 exit(EXIT_FAILURE);
             }
             fil_db_fd = g_mkstemp(fil_db_filename);
             g_debug("%s", fil_db_filename);
             if (fil_db_fd == -1) {
-                g_critical("Cannot open %s: %s", fil_db_filename, strerror(errno));
+                g_critical("Cannot open %s: %s", fil_db_filename, g_strerror(errno));
                 exit(EXIT_FAILURE);
             }
             oth_db_fd = g_mkstemp(oth_db_filename);
             g_debug("%s", oth_db_filename);
             if (oth_db_fd == -1) {
-                g_critical("Cannot open %s: %s", oth_db_filename, strerror(errno));
+                g_critical("Cannot open %s: %s", oth_db_filename, g_strerror(errno));
                 exit(EXIT_FAILURE);
             }
         }
@@ -1059,7 +1059,7 @@ main(int argc, char **argv)
                 goto deltaerror;
             }
         } else if (g_mkdir(outdeltadir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH)) {
-            g_critical("Cannot create %s: %s", outdeltadir, strerror(errno));
+            g_critical("Cannot create %s: %s", outdeltadir, g_strerror(errno));
             goto deltaerror;
         }
 
@@ -1198,7 +1198,7 @@ deltaerror:
     gchar *repomd_path = g_strconcat(tmp_out_repo, "repomd.xml", NULL);
     FILE *frepomd = fopen(repomd_path, "w");
     if (!frepomd) {
-        g_critical("Cannot open %s: %s", repomd_path, strerror(errno));
+        g_critical("Cannot open %s: %s", repomd_path, g_strerror(errno));
         exit(EXIT_FAILURE);
     }
     fputs(repomd_xml, frepomd);
@@ -1249,7 +1249,7 @@ deltaerror:
 
     if (g_rename(out_repo, old_repodata_path) == -1) {
         g_debug("Old repodata doesn't exists: Cannot rename %s -> %s: %s",
-                out_repo, old_repodata_path, strerror(errno));
+                out_repo, old_repodata_path, g_strerror(errno));
     } else {
         g_debug("Renamed %s -> %s", out_repo, old_repodata_path);
         old_repodata_renamed = TRUE;
@@ -1258,7 +1258,7 @@ deltaerror:
     // Rename tmp_out_repo to out_repo
     if (g_rename(tmp_out_repo, out_repo) == -1) {
         g_critical("Cannot rename %s -> %s: %s", tmp_out_repo, out_repo,
-                   strerror(errno));
+                   g_strerror(errno));
         exit(EXIT_FAILURE);
     } else {
         g_debug("Renamed %s -> %s", tmp_out_repo, out_repo);
index ea389bf..2d47549 100644 (file)
@@ -148,7 +148,7 @@ cr_block_terminating_signals(GError **err)
 
     if (sigprocmask(SIG_BLOCK, &intmask, NULL)) {
         g_set_error(err, CREATEREPO_C_ERROR, CRE_SIGPROCMASK,
-                    "Cannot block terminating signals: %s", strerror(errno));
+                    "Cannot block terminating signals: %s", g_strerror(errno));
         return FALSE;
     }
 
@@ -176,7 +176,7 @@ cr_unblock_terminating_signals(GError **err)
 
     if (sigprocmask(SIG_UNBLOCK, &intmask, NULL)) {
         g_set_error(err, CREATEREPO_C_ERROR, CRE_SIGPROCMASK,
-                    "Cannot unblock terminating signals: %s", strerror(errno));
+                    "Cannot unblock terminating signals: %s", g_strerror(errno));
         return FALSE;
     }
 
@@ -203,7 +203,7 @@ cr_lock_repo(const gchar *repo_dir,
         if (errno != EEXIST) {
             g_set_error(err, CREATEREPO_C_ERROR, CRE_IO,
                         "Error while creating temporary repodata "
-                        "directory: %s: %s", lock_dir, strerror(errno));
+                        "directory: %s: %s", lock_dir, g_strerror(errno));
             return FALSE;
         }
 
@@ -236,10 +236,10 @@ cr_lock_repo(const gchar *repo_dir,
         // Try to create own - just as a lock
         if (g_mkdir(lock_dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)) {
             g_critical("(--ignore-lock enabled) Cannot create %s: %s",
-                       lock_dir, strerror(errno));
+                       lock_dir, g_strerror(errno));
             g_set_error(err, CREATEREPO_C_ERROR, CRE_IO,
                         "Cannot create: %s (--ignore-lock enabled): %s",
-                        lock_dir, strerror(errno));
+                        lock_dir, g_strerror(errno));
             return FALSE;
         } else {
             g_debug("(--ignore-lock enabled) Own and empty %s created "
@@ -254,10 +254,10 @@ cr_lock_repo(const gchar *repo_dir,
 
         if (g_mkdir(tmp_repodata_dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)) {
             g_critical("(--ignore-lock enabled) Cannot create %s: %s",
-                       tmp_repodata_dir, strerror(errno));
+                       tmp_repodata_dir, g_strerror(errno));
             g_set_error(err, CREATEREPO_C_ERROR, CRE_IO,
                         "Cannot create: %s (--ignore-lock enabled): %s",
-                        tmp_repodata_dir, strerror(errno));
+                        tmp_repodata_dir, g_strerror(errno));
             return FALSE;
         } else {
             g_debug("(--ignore-lock enabled) For data generation is used: %s",
index d7dcd91..cb7997f 100644 (file)
@@ -236,7 +236,7 @@ cr_deltarpms_scan_oldpackagedirs(GSList *oldpackagedirs,
             full_path = g_build_filename(dirname, filename, NULL);
 
             if (stat(full_path, &st) == -1) {
-                g_warning("Cannot stat %s: %s", full_path, strerror(errno));
+                g_warning("Cannot stat %s: %s", full_path, g_strerror(errno));
                 g_free(full_path);
                 continue;
             }
@@ -605,7 +605,7 @@ cr_deltarpms_scan_targetdir(const char *path,
             }
 
             if (stat(full_path, &st) == -1) {
-                g_warning("Cannot stat %s: %s", full_path, strerror(errno));
+                g_warning("Cannot stat %s: %s", full_path, g_strerror(errno));
                 g_free(full_path);
                 continue;
             }
@@ -754,7 +754,7 @@ cr_prestodelta_thread(gpointer data, gpointer udata)
     // Stat the package (to get the size)
     if (stat(task->full_path, &st) == -1) {
         g_warning("%s: stat(%s) error (%s)", __func__,
-                  task->full_path, strerror(errno));
+                  task->full_path, g_strerror(errno));
         goto exit;
     } else {
         dpkg->package->size_package = st.st_size;
index 697748f..0bc3eb5 100644 (file)
@@ -255,9 +255,9 @@ load_rpm(const char *filename,
         struct stat stat_buf_own;
         if (stat(filename, &stat_buf_own) == -1) {
             g_warning("%s: stat(%s) error (%s)", __func__,
-                      filename, strerror(errno));
+                      filename, g_strerror(errno));
             g_set_error(err,  CREATEREPO_C_ERROR, CRE_IO, "stat(%s) failed: %s",
-                        filename, strerror(errno));
+                        filename, g_strerror(errno));
             goto errexit;
         }
         pkg->time_file    = stat_buf_own.st_mtime;
@@ -321,7 +321,7 @@ cr_dumper_thread(gpointer data, gpointer user_data)
     // Get stat info about file
     if (udata->old_metadata && !(udata->skip_stat)) {
         if (stat(task->full_path, &stat_buf) == -1) {
-            g_critical("Stat() on %s: %s", task->full_path, strerror(errno));
+            g_critical("Stat() on %s: %s", task->full_path, g_strerror(errno));
             goto task_cleanup;
         }
     }
index ec0b59b..5dc98a6 100644 (file)
@@ -366,7 +366,7 @@ cr_remove_metadata_classic(const char *repopath, int retain, GError **err)
         if (g_remove(full_path) != -1)
             g_debug("Removed %s", full_path);
         else
-            g_warning("Cannot remove %s: %s", full_path, strerror(errno));
+            g_warning("Cannot remove %s: %s", full_path, g_strerror(errno));
 
         g_free(full_path);
     }
index ded0e92..b4a04e6 100644 (file)
@@ -171,7 +171,7 @@ cr_get_remote_metadata(const char *repopath, gboolean ignore_sqlite)
     tmp_dir = g_build_filename(g_get_tmp_dir(), TMPDIR_PATTERN, NULL);
     if(!mkdtemp(tmp_dir)) {
         g_critical("%s: Cannot create a temporary directory: %s",
-                   __func__, strerror(errno));
+                   __func__, g_strerror(errno));
         return ret;
     }
 
index 88946ac..1bef11a 100644 (file)
@@ -1587,7 +1587,7 @@ main(int argc, char **argv)
 
     if (g_mkdir_with_parents (cmd_options->tmp_out_repo, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)) {
         g_critical("Error while creating temporary repodata directory %s: %s",
-                    cmd_options->tmp_out_repo, strerror(errno));
+                    cmd_options->tmp_out_repo, g_strerror(errno));
 
         free_options(cmd_options);
         return 1;
index 31cb2a8..a8974b1 100644 (file)
@@ -252,9 +252,9 @@ cr_get_header_byte_range(const char *filename, GError **err)
     FILE *fp = fopen(filename, "rb");
     if (!fp) {
         g_debug("%s: Cannot open file %s (%s)", __func__, filename,
-                strerror(errno));
+                g_strerror(errno));
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Cannot open %s: %s", filename, strerror(errno));
+                    "Cannot open %s: %s", filename, g_strerror(errno));
         return results;
     }
 
@@ -263,9 +263,9 @@ cr_get_header_byte_range(const char *filename, GError **err)
 
     if (fseek(fp, 104, SEEK_SET) != 0) {
         g_debug("%s: fseek fail on %s (%s)", __func__, filename,
-                strerror(errno));
+                g_strerror(errno));
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Cannot seek over %s: %s", filename, strerror(errno));
+                    "Cannot seek over %s: %s", filename, g_strerror(errno));
         fclose(fp);
         return results;
     }
@@ -274,14 +274,14 @@ cr_get_header_byte_range(const char *filename, GError **err)
     unsigned int sigdata  = 0;
     if (fread(&sigindex, VAL_LEN, 1, fp) != 1) {
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "fread() error on %s: %s", filename, strerror(errno));
+                    "fread() error on %s: %s", filename, g_strerror(errno));
         fclose(fp);
         return results;
     }
     sigindex = htonl(sigindex);
     if (fread(&sigdata, VAL_LEN, 1, fp) != 1) {
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "fread() error on %s: %s", filename, strerror(errno));
+                    "fread() error on %s: %s", filename, g_strerror(errno));
         fclose(fp);
         return results;
     }
@@ -302,14 +302,14 @@ cr_get_header_byte_range(const char *filename, GError **err)
     unsigned int hdrdata  = 0;
     if (fread(&hdrindex, VAL_LEN, 1, fp) != 1) {
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "fread() error on %s: %s", filename, strerror(errno));
+                    "fread() error on %s: %s", filename, g_strerror(errno));
         fclose(fp);
         return results;
     }
     hdrindex = htonl(hdrindex);
     if (fread(&hdrdata, VAL_LEN, 1, fp) != 1) {
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "fread() error on %s: %s", filename, strerror(errno));
+                    "fread() error on %s: %s", filename, g_strerror(errno));
         fclose(fp);
         return results;
     }
@@ -382,18 +382,18 @@ cr_copy_file(const char *src, const char *in_dst, GError **err)
     // Open src file
     if ((orig = fopen(src, "rb")) == NULL) {
         g_debug("%s: Cannot open source file %s (%s)", __func__, src,
-                strerror(errno));
+                g_strerror(errno));
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Cannot open file %s: %s", src, strerror(errno));
+                    "Cannot open file %s: %s", src, g_strerror(errno));
         return FALSE;
     }
 
     // Open dst file
     if ((new = fopen(dst, "wb")) == NULL) {
         g_debug("%s: Cannot open destination file %s (%s)", __func__, dst,
-                strerror(errno));
+                g_strerror(errno));
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Cannot open file %s: %s", dst, strerror(errno));
+                    "Cannot open file %s: %s", dst, g_strerror(errno));
         return FALSE;
     }
 
@@ -401,15 +401,15 @@ cr_copy_file(const char *src, const char *in_dst, GError **err)
     while ((readed = fread(buf, 1, BUFFER_SIZE, orig)) > 0) {
         if (readed != BUFFER_SIZE && ferror(orig)) {
             g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Error while read %s: %s", src, strerror(errno));
+                    "Error while read %s: %s", src, g_strerror(errno));
             return FALSE;
         }
 
         if (fwrite(buf, 1, readed, new) != readed) {
             g_debug("%s: Error while copy %s -> %s (%s)", __func__, src,
-                    dst, strerror(errno));
+                    dst, g_strerror(errno));
             g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Error while write %s: %s", dst, strerror(errno));
+                    "Error while write %s: %s", dst, g_strerror(errno));
             return FALSE;
         }
     }
@@ -461,9 +461,9 @@ cr_compress_file_with_stat(const char *src,
     orig = fopen(src, "rb");
     if (orig == NULL) {
         g_debug("%s: Cannot open source file %s (%s)", __func__, src,
-                strerror(errno));
+                g_strerror(errno));
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Cannot open %s: %s", src, strerror(errno));
+                    "Cannot open %s: %s", src, g_strerror(errno));
         ret = CRE_IO;
         goto compress_file_cleanup;
     }
@@ -479,9 +479,9 @@ cr_compress_file_with_stat(const char *src,
     while ((readed = fread(buf, 1, BUFFER_SIZE, orig)) > 0) {
         if (readed != BUFFER_SIZE && ferror(orig)) {
             g_debug("%s: Error while copy %s -> %s (%s)", __func__, src,
-                    dst, strerror(errno));
+                    dst, g_strerror(errno));
             g_set_error(err, ERR_DOMAIN, CRE_IO,
-                        "Error while read %s: %s", src, strerror(errno));
+                        "Error while read %s: %s", src, g_strerror(errno));
             ret = CRE_IO;
             goto compress_file_cleanup;
         }
@@ -584,9 +584,9 @@ cr_decompress_file_with_stat(const char *src,
     new = fopen(dst, "wb");
     if (!new) {
         g_debug("%s: Cannot open destination file %s (%s)",
-                __func__, dst, strerror(errno));
+                __func__, dst, g_strerror(errno));
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Cannot open %s: %s", src, strerror(errno));
+                    "Cannot open %s: %s", src, g_strerror(errno));
         ret = CRE_IO;
         goto compress_file_cleanup;
     }
@@ -603,9 +603,9 @@ cr_decompress_file_with_stat(const char *src,
 
         if (fwrite(buf, 1, readed, new) != (size_t) readed) {
             g_debug("%s: Error while copy %s -> %s (%s)",
-                    __func__, src, dst, strerror(errno));
+                    __func__, src, dst, g_strerror(errno));
             g_set_error(err, ERR_DOMAIN, CRE_IO,
-                        "Error while write %s: %s", dst, strerror(errno));
+                        "Error while write %s: %s", dst, g_strerror(errno));
             ret = CRE_IO;
             goto compress_file_cleanup;
         }
@@ -654,7 +654,7 @@ cr_download(CURL *in_handle,
     file = fopen(dst, "wb");
     if (!file) {
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Cannot open %s: %s", dst, strerror(errno));
+                    "Cannot open %s: %s", dst, g_strerror(errno));
         remove(dst);
         return CRE_IO;
     }
@@ -745,7 +745,7 @@ cr_remove_dir_cb(const char *fpath,
     CR_UNUSED(ftwbuf);
     int rv = remove(fpath);
     if (rv)
-        g_warning("%s: Cannot remove: %s: %s", __func__, fpath, strerror(errno));
+        g_warning("%s: Cannot remove: %s: %s", __func__, fpath, g_strerror(errno));
 
     return rv;
 }
@@ -761,7 +761,7 @@ cr_remove_dir(const char *path, GError **err)
     ret = nftw(path, cr_remove_dir_cb, 64, FTW_DEPTH | FTW_PHYS);
     if (ret != 0) {
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Cannot remove dir %s: %s", path, strerror(errno));
+                    "Cannot remove dir %s: %s", path, g_strerror(errno));
         return CRE_IO;
     }
 
@@ -1274,7 +1274,7 @@ cr_write_to_file(GError **err, gchar *filename, const char *format, ...)
     FILE *f = fopen(filename, "w");
     if (!f) {
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Cannot open %s: %s", filename, strerror(errno));
+                    "Cannot open %s: %s", filename, g_strerror(errno));
         return FALSE;
     }
 
@@ -1288,7 +1288,7 @@ cr_write_to_file(GError **err, gchar *filename, const char *format, ...)
     if (ferror(f)) {
         g_set_error(err, ERR_DOMAIN, CRE_IO,
                     "Cannot write content to %s: %s",
-                    filename, strerror(errno));
+                    filename, g_strerror(errno));
         ret = FALSE;
     }
 
index d5bc2a1..2262d6a 100644 (file)
@@ -347,7 +347,7 @@ cr_modifyrepo(GSList *modifyrepotasks, gchar *repopath, GError **err)
         g_debug("%s: Removing \"%s\"", __func__, realpath);
 
         if (remove(realpath) == -1)
-            g_warning("Cannot remove \"%s\": %s", realpath, strerror(errno));
+            g_warning("Cannot remove \"%s\": %s", realpath, g_strerror(errno));
         g_free(realpath);
     }
     cr_slist_free_full(recordstoremove, (GDestroyNotify)cr_repomd_record_free);
index 7abf04f..f6038bd 100644 (file)
@@ -93,9 +93,9 @@ read_header(const char *filename, Header *hdr, GError **err)
     FD_t fd = Fopen(filename, "r.ufdio");
     if (!fd) {
         g_warning("%s: Fopen of %s failed %s",
-                  __func__, filename, strerror(errno));
+                  __func__, filename, g_strerror(errno));
         g_set_error(err, ERR_DOMAIN, CRE_IO,
-                    "Fopen failed: %s", strerror(errno));
+                    "Fopen failed: %s", g_strerror(errno));
         return FALSE;
     }
 
@@ -177,9 +177,9 @@ cr_package_from_rpm(const char *filename,
         struct stat stat_buf_own;
         if (stat(filename, &stat_buf_own) == -1) {
             g_warning("%s: stat(%s) error (%s)", __func__,
-                      filename, strerror(errno));
+                      filename, g_strerror(errno));
             g_set_error(err,  ERR_DOMAIN, CRE_IO, "stat(%s) failed: %s",
-                        filename, strerror(errno));
+                        filename, g_strerror(errno));
             goto errexit;
         }
         pkg->time_file    = stat_buf_own.st_mtime;
index 8611b08..89495df 100644 (file)
@@ -296,7 +296,7 @@ cr_repomd_record_fill(cr_RepomdRecord *md,
         } else {
             g_warning("%s: Stat on file \"%s\" failed", __func__, path);
             g_set_error(err, ERR_DOMAIN, CRE_STAT,
-                        "Stat() on %s failed: %s", path, strerror(errno));
+                        "Stat() on %s failed: %s", path, g_strerror(errno));
             return CRE_STAT;
         }
     }
index 8fab344..d27552b 100644 (file)
@@ -1530,7 +1530,7 @@ cr_db_open(const char *path, cr_DatabaseType db_type, GError **err)
         struct stat stat_buf;
         if (stat(path, &stat_buf) == -1) {
             g_set_error(err, ERR_DOMAIN, CRE_IO,
-                        "Cannot stat %s: %s", path, strerror(errno));
+                        "Cannot stat %s: %s", path, g_strerror(errno));
             return NULL;
         }
 
index 3d1c121..ac8ab6e 100644 (file)
@@ -865,19 +865,19 @@ generate_sqlite_from_xml(const gchar *path,
         pri_db_fd = g_mkstemp(pri_db_filename);
         g_debug("%s", pri_db_filename);
         if (pri_db_fd == -1) {
-            g_critical("Cannot open %s: %s", pri_db_filename, strerror(errno));
+            g_critical("Cannot open %s: %s", pri_db_filename, g_strerror(errno));
             exit(EXIT_FAILURE);
         }
         fil_db_fd = g_mkstemp(fil_db_filename);
         g_debug("%s", fil_db_filename);
         if (fil_db_fd == -1) {
-            g_critical("Cannot open %s: %s", fil_db_filename, strerror(errno));
+            g_critical("Cannot open %s: %s", fil_db_filename, g_strerror(errno));
             exit(EXIT_FAILURE);
         }
         oth_db_fd = g_mkstemp(oth_db_filename);
         g_debug("%s", oth_db_filename);
         if (oth_db_fd == -1) {
-            g_critical("Cannot open %s: %s", oth_db_filename, strerror(errno));
+            g_critical("Cannot open %s: %s", oth_db_filename, g_strerror(errno));
             exit(EXIT_FAILURE);
         }
     }