From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: fix debug in volume id / fix clashing global var name
Date: Mon, 18 Oct 2004 21:46:57 +0000 [thread overview]
Message-ID: <20041018214657.GA8164@vrfy.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 173 bytes --]
Here we get the logging for udev_volume_id working if it is compiled
with DEBUG=true. Also fixed is a name clash with a global variable.
Queue is empty now :)
Thanks,
Kay
[-- Attachment #2: udev-volume_id-log-01.patch --]
[-- Type: text/plain, Size: 3367 bytes --]
===== wait_for_sysfs.c 1.24 vs edited =====
--- 1.24/wait_for_sysfs.c 2004-10-18 18:53:13 +02:00
+++ edited/wait_for_sysfs.c 2004-10-18 23:32:41 +02:00
@@ -386,7 +386,7 @@ int main(int argc, char *argv[], char *e
const char *devpath = "";
const char *action;
const char *subsystem;
- char sysfs_path[SYSFS_PATH_MAX];
+ char sysfs_mnt_path[SYSFS_PATH_MAX];
char filename[SYSFS_PATH_MAX];
struct sysfs_class_device *class_dev;
struct sysfs_device *devices_dev;
@@ -421,14 +421,14 @@ int main(int argc, char *argv[], char *e
goto exit;
}
- if (sysfs_get_mnt_path(sysfs_path, SYSFS_PATH_MAX) != 0) {
+ if (sysfs_get_mnt_path(sysfs_mnt_path, SYSFS_PATH_MAX) != 0) {
dbg("error: no sysfs path");
rc = 2;
goto exit;
}
if ((strncmp(devpath, "/block/", 7) == 0) || (strncmp(devpath, "/class/", 7) == 0)) {
- snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_path, devpath);
+ snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_mnt_path, devpath);
filename[SYSFS_PATH_MAX-1] = '\0';
/* open the class device we are called for */
@@ -445,7 +445,7 @@ int main(int argc, char *argv[], char *e
sysfs_close_class_device(class_dev);
} else if ((strncmp(devpath, "/devices/", 9) == 0)) {
- snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_path, devpath);
+ snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_mnt_path, devpath);
filename[SYSFS_PATH_MAX-1] = '\0';
/* open the path we are called for */
===== extras/volume_id/Makefile 1.4 vs edited =====
--- 1.4/extras/volume_id/Makefile 2004-10-15 19:49:26 +02:00
+++ edited/extras/volume_id/Makefile 2004-10-18 23:28:29 +02:00
@@ -28,9 +28,8 @@ INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
-override CFLAGS+=-Wall -fno-builtin -Wchar-subscripts -Wmissing-declarations \
- -Wnested-externs -Wpointer-arith -Wcast-align \
- -Wsign-compare
+override CFLAGS+=-Wall -fno-builtin -Wchar-subscripts \
+ -Wpointer-arith -Wcast-align -Wsign-compare
override CFLAGS+=-D_FILE_OFFSET_BITS=64
===== extras/volume_id/udev_volume_id.c 1.4 vs edited =====
--- 1.4/extras/volume_id/udev_volume_id.c 2004-09-18 22:40:49 +02:00
+++ edited/extras/volume_id/udev_volume_id.c 2004-10-18 23:35:49 +02:00
@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
" -d disk label from main device\n"
"\n";
static const char short_options[] = "htlud";
- char sysfs_path[SYSFS_PATH_MAX];
+ char sysfs_mnt_path[SYSFS_PATH_MAX];
char dev_path[SYSFS_PATH_MAX];
struct sysfs_class_device *class_dev = NULL;
struct sysfs_class_device *class_dev_parent = NULL;
@@ -118,6 +118,8 @@ int main(int argc, char *argv[])
unsigned long long size;
int rc = 1;
+ logging_init("udev_volume_id");
+
while (1) {
int option;
@@ -152,12 +154,12 @@ int main(int argc, char *argv[])
goto exit;
}
- if (sysfs_get_mnt_path(sysfs_path, SYSFS_PATH_MAX) != 0) {
+ if (sysfs_get_mnt_path(sysfs_mnt_path, SYSFS_PATH_MAX) != 0) {
printf("error getting sysfs mount path\n");
goto exit;
}
- strfieldcpy(dev_path, sysfs_path);
+ strfieldcpy(dev_path, sysfs_mnt_path);
strfieldcat(dev_path, devpath);
class_dev = sysfs_open_class_device_path(dev_path);
@@ -260,6 +262,8 @@ exit:
sysfs_close_class_device(class_dev);
if (vid != NULL)
volume_id_close(vid);
+
+ logging_close();
exit(rc);
}
next reply other threads:[~2004-10-18 21:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-18 21:46 Kay Sievers [this message]
2004-10-18 22:17 ` fix debug in volume id / fix clashing global var name Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041018214657.GA8164@vrfy.org \
--to=kay.sievers@vrfy.org \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.