sr_info("Uploading firmware at %s", filename);
if (!(fw = g_fopen(filename, "rb"))) {
sr_err("Unable to open firmware file %s for reading: %s",
- filename, strerror(errno));
+ filename, g_strerror(errno));
return SR_ERR;
}
fd = g_fopen(path, "w");
if (!fd) {
- sr_err("Error opening %s: %s", path, strerror(errno));
+ sr_err("Error opening %s: %s", path, g_strerror(errno));
return -1;
}
wr = g_fprintf(fd, "%s", buf);
fclose(fd);
if (wr < 0) {
- sr_err("Error writing to %s: %s", path, strerror(errno));
+ sr_err("Error writing to %s: %s", path, g_strerror(errno));
return -1;
}
g_string_printf(path, "/sys/class/gpio/gpio%d/value", gpio);
fd = g_fopen(path->str, "r");
if (!fd) {
- sr_err("Error opening %s: %s", path->str, strerror(errno));
+ sr_err("Error opening %s: %s", path->str, g_strerror(errno));
g_string_free(path, TRUE);
return -1;
}
status = fscanf(fd, "%d", &ret);
fclose(fd);
if (status != 1) {
- sr_err("Error reading from %s: %s", path, strerror(errno));
+ sr_err("Error reading from %s: %s", path, g_strerror(errno));
g_string_free(path, TRUE);
return -1;
}
*/
fd = g_fopen(path->str, "w");
if (!fd) {
- sr_err("Error opening %s: %s", path->str, strerror(errno));
+ sr_err("Error opening %s: %s", path->str, g_strerror(errno));
ret = SR_ERR_IO;
goto out;
}
len = read(fd, buf, sizeof(buf));
if (len < 0) {
sr_err("Error reading from channel %s (hwmon: %s): %s",
- ch->name, chp->probe->hwmon_num, strerror(errno));
+ ch->name, chp->probe->hwmon_num, g_strerror(errno));
ch->enabled = FALSE;
return -1.0;
}
fd = open(path, O_RDONLY);
if (fd < 0) {
- sr_err("Error opening %s: %s", path, strerror(errno));
+ sr_err("Error opening %s: %s", path, g_strerror(errno));
ch->enabled = FALSE;
return SR_ERR;
}
usb = sdi->conn;
if (stat(filename, &st) < 0) {
- sr_err("Unable to upload FPGA firmware: %s", strerror(errno));
+ sr_err("Unable to upload FPGA firmware: %s", g_strerror(errno));
return SR_ERR;
}
buf = g_malloc(FW_BUFSIZE);
if (!(fw = g_fopen(filename, "rb"))) {
- sr_err("Unable to open %s for reading: %s.", filename, strerror(errno));
+ sr_err("Unable to open %s for reading: %s.", filename, g_strerror(errno));
return SR_ERR;
}
case AQ_I2:
if (sr_atod(devc->buf, &dbl) != SR_OK) {
sr_err("Failed to convert '%s' to double, errno=%d %s",
- devc->buf, errno, strerror(errno));
+ devc->buf, errno, g_strerror(errno));
dbl = 0.0;
}
break;
case AQ_STATUS:
if (sr_atoi(devc->buf, &auxint) != SR_OK) {
sr_err("Failed to convert '%s' to int, errno=%d %s",
- devc->buf, errno, strerror(errno));
+ devc->buf, errno, g_strerror(errno));
auxint = 0;
}
break;
sr_info("Uploading FPGA bitstream at %s.", filename);
if (!(fw = g_fopen(filename, "rb"))) {
sr_err("Unable to open bitstream file %s for reading: %s.",
- filename, strerror(errno));
+ filename, g_strerror(errno));
return SR_ERR;
}
}
if (stat(filename, &st) < 0) {
- sr_err("%s", strerror(errno));
+ sr_err("%s", g_strerror(errno));
return SR_ERR_ARG;
}
GINT_TO_POINTER(st.st_size));
} else if (mitem == SR_INPUT_META_HEADER) {
if ((fd = open(filename, O_RDONLY)) < 0) {
- sr_err("%s", strerror(errno));
+ sr_err("%s", g_strerror(errno));
return SR_ERR;
}
size = read(fd, header_buf->str, 128);
close(fd);
if (size <= 0) {
g_string_free(header_buf, TRUE);
- sr_err("%s", strerror(errno));
+ sr_err("%s", g_strerror(errno));
return SR_ERR;
}
g_hash_table_insert(meta, GINT_TO_POINTER(mitem), header_buf);
if ((tmpfile = g_mkstemp(tmpname)) == -1)
return SR_ERR;
if (write(tmpfile, metafile, len) < 0) {
- sr_dbg("Failed to create new metadata: %s", strerror(errno));
+ sr_dbg("Failed to create new metadata: %s", g_strerror(errno));
g_free(metafile);
unlink(tmpname);
return SR_ERR;
if (tcp->socket < 0) {
sr_err("Failed to connect to %s:%s: %s", tcp->address, tcp->port,
- strerror(errno));
+ g_strerror(errno));
return SR_ERR;
}
g_free(terminated_command);
if (out < 0) {
- sr_err("Send error: %s", strerror(errno));
+ sr_err("Send error: %s", g_strerror(errno));
return SR_ERR;
}
len = recv(tcp->socket, buf, maxlen, 0);
if (len < 0) {
- sr_err("Receive error: %s", strerror(errno));
+ sr_err("Receive error: %s", g_strerror(errno));
return SR_ERR;
}
len = recv(tcp->socket, tcp->length_buf + tcp->length_bytes_read,
LENGTH_BYTES - tcp->length_bytes_read, 0);
if (len < 0) {
- sr_err("Receive error: %s", strerror(errno));
+ sr_err("Receive error: %s", g_strerror(errno));
return SR_ERR;
}
len = recv(tcp->socket, buf, maxlen, 0);
if (len < 0) {
- sr_err("Receive error: %s", strerror(errno));
+ sr_err("Receive error: %s", g_strerror(errno));
return SR_ERR;
}
return SR_ERR_ARG;
if (stat(filename, &st) == -1) {
- sr_err("Couldn't stat %s: %s", filename, strerror(errno));
+ sr_err("Couldn't stat %s: %s", filename, g_strerror(errno));
return SR_ERR;
}
if ((tmpfile = g_mkstemp(tmpname)) == -1)
return SR_ERR;
if (write(tmpfile, metafile, len) < 0) {
- sr_dbg("Failed to create new metadata: %s", strerror(errno));
+ sr_dbg("Failed to create new metadata: %s", g_strerror(errno));
g_free(metafile);
unlink(tmpname);
return SR_ERR;