]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/lib/util/string.c
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / lib / util / string.c
index c3b6a3f160d5c80fe2d20edf9ce78e272db17360..30ac1628a829de0621590c33b7aa09d0da3d8d12 100644 (file)
@@ -341,7 +341,9 @@ spdk_strerror_r(int errnum, char *buf, size_t buflen)
 #if defined(__USE_GNU)
        char *new_buffer;
        new_buffer = strerror_r(errnum, buf, buflen);
-       if (new_buffer != NULL) {
+       if (new_buffer == buf) {
+               rc = 0;
+       } else if (new_buffer != NULL) {
                snprintf(buf, buflen, "%s", new_buffer);
                rc = 0;
        } else {