|
| 1 | +From 6a06cb6dba0065705179329729cca2f95a842a63 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Rudi Heitbaum <rudi@heitbaum.com> |
| 3 | +Date: Sun, 25 Jan 2026 08:42:18 +0000 |
| 4 | +Subject: [PATCH] use const qualifier from pointer target type |
| 5 | + |
| 6 | +Fixes: |
| 7 | + ../../lib/nfs_v3.c: In function 'nfs3_mknod_async': |
| 8 | + ../../lib/nfs_v3.c:3260:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] |
| 9 | + 3260 | ptr = strrchr(path, '/'); |
| 10 | + | ^ |
| 11 | + ../../lib/nfs_v3.c: In function 'nfs3_unlink_async': |
| 12 | + ../../lib/nfs_v3.c:3361:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] |
| 13 | + 3361 | ptr = strrchr(path, '/'); |
| 14 | + | ^ |
| 15 | + ../../lib/nfs_v3.c: In function 'nfs3_rmdir_async': |
| 16 | + ../../lib/nfs_v3.c:3472:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] |
| 17 | + 3472 | ptr = strrchr(path, '/'); |
| 18 | + | ^ |
| 19 | + ../../lib/nfs_v3.c: In function 'nfs3_mkdir2_async': |
| 20 | + ../../lib/nfs_v3.c:3574:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] |
| 21 | + 3574 | ptr = strrchr(path, '/'); |
| 22 | + | ^ |
| 23 | +--- |
| 24 | + lib/nfs_v3.c | 24 ++++++++++++------------ |
| 25 | + 1 file changed, 12 insertions(+), 12 deletions(-) |
| 26 | + |
| 27 | +diff --git a/lib/nfs_v3.c b/lib/nfs_v3.c |
| 28 | +index addd0ae..2c32fff 100644 |
| 29 | +--- a/lib/nfs_v3.c |
| 30 | ++++ b/lib/nfs_v3.c |
| 31 | +@@ -3244,7 +3244,7 @@ int |
| 32 | + nfs3_mknod_async(struct nfs_context *nfs, const char *path, int mode, int dev, |
| 33 | + nfs_cb cb, void *private_data) |
| 34 | + { |
| 35 | +- char *ptr; |
| 36 | ++ const char *ptr; |
| 37 | + struct mknod_cb_data *cb_data; |
| 38 | + |
| 39 | + cb_data = malloc(sizeof(struct mknod_cb_data)); |
| 40 | +@@ -3262,8 +3262,8 @@ nfs3_mknod_async(struct nfs_context *nfs, const char *path, int mode, int dev, |
| 41 | + "buffer for mknod path"); |
| 42 | + return -1; |
| 43 | + } |
| 44 | +- ptr = strrchr(cb_data->path, '/'); |
| 45 | +- *ptr = 0; |
| 46 | ++ char *ptr2 = strrchr(cb_data->path, '/'); |
| 47 | ++ *ptr2 = 0; |
| 48 | + } else { |
| 49 | + cb_data->path = malloc(strlen(path) + 2); |
| 50 | + if (cb_data->path == NULL) { |
| 51 | +@@ -3353,7 +3353,7 @@ nfs3_unlink_async(struct nfs_context *nfs, const char *path, nfs_cb cb, |
| 52 | + void *private_data) |
| 53 | + { |
| 54 | + char *new_path; |
| 55 | +- char *ptr; |
| 56 | ++ const char *ptr; |
| 57 | + |
| 58 | + ptr = strrchr(path, '/'); |
| 59 | + if (ptr) { |
| 60 | +@@ -3363,8 +3363,8 @@ nfs3_unlink_async(struct nfs_context *nfs, const char *path, nfs_cb cb, |
| 61 | + "buffer for unlink path"); |
| 62 | + return -1; |
| 63 | + } |
| 64 | +- ptr = strrchr(new_path, '/'); |
| 65 | +- *ptr = 0; |
| 66 | ++ char *ptr2 = strrchr(new_path, '/'); |
| 67 | ++ *ptr2 = 0; |
| 68 | + } else { |
| 69 | + new_path = malloc(strlen(path) + 2); |
| 70 | + if (new_path == NULL) { |
| 71 | +@@ -3464,7 +3464,7 @@ nfs3_rmdir_async(struct nfs_context *nfs, const char *path, nfs_cb cb, |
| 72 | + void *private_data) |
| 73 | + { |
| 74 | + char *new_path; |
| 75 | +- char *ptr; |
| 76 | ++ const char *ptr; |
| 77 | + |
| 78 | + ptr = strrchr(path, '/'); |
| 79 | + if (ptr) { |
| 80 | +@@ -3474,8 +3474,8 @@ nfs3_rmdir_async(struct nfs_context *nfs, const char *path, nfs_cb cb, |
| 81 | + "buffer for rmdir path"); |
| 82 | + return -1; |
| 83 | + } |
| 84 | +- ptr = strrchr(new_path, '/'); |
| 85 | +- *ptr = 0; |
| 86 | ++ char *ptr2 = strrchr(new_path, '/'); |
| 87 | ++ *ptr2 = 0; |
| 88 | + } else { |
| 89 | + new_path = malloc(strlen(path) + 2); |
| 90 | + if (new_path == NULL) { |
| 91 | +@@ -3566,7 +3566,7 @@ nfs3_mkdir2_async(struct nfs_context *nfs, const char *path, int mode, |
| 92 | + nfs_cb cb, void *private_data) |
| 93 | + { |
| 94 | + char *new_path; |
| 95 | +- char *ptr; |
| 96 | ++ const char *ptr; |
| 97 | + |
| 98 | + ptr = strrchr(path, '/'); |
| 99 | + if (ptr) { |
| 100 | +@@ -3576,8 +3576,8 @@ nfs3_mkdir2_async(struct nfs_context *nfs, const char *path, int mode, |
| 101 | + "buffer for mkdir path"); |
| 102 | + return -1; |
| 103 | + } |
| 104 | +- ptr = strrchr(new_path, '/'); |
| 105 | +- *ptr = 0; |
| 106 | ++ char *ptr2 = strrchr(new_path, '/'); |
| 107 | ++ *ptr2 = 0; |
| 108 | + } else { |
| 109 | + new_path = malloc(strlen(path) + 2); |
| 110 | + if (new_path == NULL) { |
| 111 | +-- |
| 112 | +2.51.0 |
| 113 | + |
0 commit comments