[systemd-devel] [PATCH] libudev-queue.c: simplified open_queue_file

Arvydas Sidorenko asido4 at gmail.com
Tue Jul 31 02:38:08 PDT 2012


There is no apparent justification for using util_strscpyl
on the filename since it's a plain hardcoded path.
Older versions used:
util_strscpyl(filename, sizeof(filename), SOME_DIR, "/queue.bin", NULL);
and when changed nobody bothered to simplify it.

Signed-off-by: Arvydas Sidorenko <asido4 at gmail.com>
---
 src/libudev/libudev-queue.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/libudev/libudev-queue.c b/src/libudev/libudev-queue.c
index 1b3da39..93841fe 100644
--- a/src/libudev/libudev-queue.c
+++ b/src/libudev/libudev-queue.c
@@ -210,11 +210,9 @@ ssize_t udev_queue_read_devpath(FILE *queue_file, char *devpath, size_t size)
 
 static FILE *open_queue_file(struct udev_queue *udev_queue, unsigned long long int *seqnum_start)
 {
-        char filename[UTIL_PATH_SIZE];
         FILE *queue_file;
 
-        util_strscpyl(filename, sizeof(filename), "/run/udev/queue.bin", NULL);
-        queue_file = fopen(filename, "re");
+        queue_file = fopen("/run/udev/queue.bin", "re");
         if (queue_file == NULL)
                 return NULL;
 
-- 
1.7.8.6



More information about the systemd-devel mailing list