chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
extras: ignore built and generated files
[elogind.git]
/
extras
/
cdrom_id
/
cdrom_id.c
diff --git
a/extras/cdrom_id/cdrom_id.c
b/extras/cdrom_id/cdrom_id.c
index 3d627811867b3f848831f6ee324838a2336eaf88..0d4a8c10f02fa0fb2a08bc1b1776110278745fdc 100644
(file)
--- a/
extras/cdrom_id/cdrom_id.c
+++ b/
extras/cdrom_id/cdrom_id.c
@@
-7,9
+7,6
@@
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 of the License.
*
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 of the License.
*
- * Framework based on ata_id which is:
- * Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
- *
*/
#ifndef _GNU_SOURCE
*/
#ifndef _GNU_SOURCE
@@
-21,14
+18,14
@@
#include <unistd.h>
#include <fcntl.h>
#include <ctype.h>
#include <unistd.h>
#include <fcntl.h>
#include <ctype.h>
+#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <linux/types.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <linux/types.h>
-#include "../../logging.h"
-#include "../../udev_utils.h"
+#include "../../udev.h"
/*
* Taken from the cdrom.h kernel include file.
/*
* Taken from the cdrom.h kernel include file.
@@
-107,24
+104,21
@@
int main(int argc, char *argv[])
node = arg;
}
if (!node) {
node = arg;
}
if (!node) {
-
err
("no node specified");
+
info
("no node specified");
rc = 1;
goto exit;
}
rc = 1;
goto exit;
}
- fd = open(node, O_RDONLY);
- if (fd < 0)
- if (errno == ENOMEDIUM)
- fd = open(node, O_RDONLY|O_NONBLOCK);
+ fd = open(node, O_RDONLY|O_NONBLOCK);
if (fd < 0) {
if (fd < 0) {
-
err
("unable to open '%s'", node);
+
info
("unable to open '%s'", node);
rc = 1;
goto exit;
}
result = ioctl(fd, CDROM_GET_CAPABILITY, NULL);
if (result < 0) {
rc = 1;
goto exit;
}
result = ioctl(fd, CDROM_GET_CAPABILITY, NULL);
if (result < 0) {
-
err("CDROM_GET_C
ABILITY failed for '%s'", node);
+
info("CDROM_GET_CAP
ABILITY failed for '%s'", node);
rc = 3;
goto close;
}
rc = 3;
goto close;
}
@@
-150,8
+144,6
@@
int main(int argc, char *argv[])
if (result & CDC_RAM)
printf("ID_CDROM_RAM=1\n");
if (result & CDC_RAM)
printf("ID_CDROM_RAM=1\n");
- goto close;
-
close:
close(fd);
exit:
close:
close(fd);
exit: