From: Uwe Hermann Date: Sat, 5 Feb 2011 19:03:17 +0000 (+0100) Subject: Use glib's g_fopen() instead of fopen(). X-Git-Tag: libsigrok-0.1.0~345 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=868d8cefec0d27bc5afed4fe1e906c7b68665cf6;p=libsigrok.git Use glib's g_fopen() instead of fopen(). --- diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index c89ed31f..9144f196 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -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; } diff --git a/hardware/common/ezusb.c b/hardware/common/ezusb.c index 587abe7f..e3a44261 100644 --- a/hardware/common/ezusb.c +++ b/hardware/common/ezusb.c @@ -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; diff --git a/session_file.c b/session_file.c index d6480b68..fd8f9c67 100644 --- a/session_file.c +++ b/session_file.c @@ -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 */