]> sigrok.org Git - libsigrok.git/commitdiff
Use glib's g_fopen() instead of fopen().
authorUwe Hermann <redacted>
Sat, 5 Feb 2011 19:03:17 +0000 (20:03 +0100)
committerUwe Hermann <redacted>
Sat, 5 Feb 2011 19:03:17 +0000 (20:03 +0100)
hardware/asix-sigma/asix-sigma.c
hardware/common/ezusb.c
session_file.c

index c89ed31f65cc2ee45943b105713715230db3b03d..9144f196bcc76b2223f4c62d8fdef2c2ebca6f78 100644 (file)
@@ -312,9 +312,9 @@ static int bin2bitbang(const char *filename,
        int c, ret, bit, v;
        uint32_t imm = 0x3f6df2ab;
 
-       f = fopen(filename, "rb");
+       f = g_fopen(filename, "rb");
        if (!f) {
-               g_warning("fopen(\"%s\", \"rb\")", filename);
+               g_warning("g_fopen(\"%s\", \"rb\")", filename);
                return -1;
        }
 
index 587abe7fffc4413199c987e4d41c98ba02d33780..e3a442611b6254dff604549d84796d875dd326bd 100644 (file)
@@ -50,7 +50,7 @@ int ezusb_install_firmware(libusb_device_handle *hdl, const char *filename)
        unsigned char buf[4096];
 
        g_message("Uploading firmware at %s", filename);
-       if ((fw = fopen(filename, "rb")) == NULL) {
+       if ((fw = g_fopen(filename, "rb")) == NULL) {
                g_warning("Unable to open firmware file %s for reading: %s",
                          filename, strerror(errno));
                return 1;
index d6480b682e1d4ac67127cfbbd889c3aa85bcf427..fd8f9c67480423a789ea107ee8ce6694e23f30ce 100644 (file)
@@ -168,7 +168,7 @@ int session_save(char *filename)
        if ((tmpfile = g_mkstemp(metafile)) == -1)
                return SR_ERR;
        close(tmpfile);
-       meta = fopen(metafile, "wb");
+       meta = g_fopen(metafile, "wb");
        fprintf(meta, "[global]\n");
        fprintf(meta, "sigrok version = %s\n", PACKAGE_VERSION);
        /* TODO: save protocol decoders used */