chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make struct option arrays static const
[elogind.git]
/
udev_db.c
diff --git
a/udev_db.c
b/udev_db.c
index c3034f5037f1320e6090c43799eb747212ee0ce9..f3c9509dcc8767c592af4ce17a0a010eca94143b 100644
(file)
--- a/
udev_db.c
+++ b/
udev_db.c
@@
-1,6
+1,4
@@
/*
/*
- * udev_db.c
- *
* Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org>
*
* Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org>
*
@@
-15,7
+13,7
@@
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
- *
675 Mass Ave, Cambridge, MA 02139
, USA.
+ *
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
, USA.
*
*/
*
*/
@@
-29,6
+27,8
@@
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include "udev.h"
#include "udev.h"
@@
-81,8
+81,7
@@
int udev_db_add_device(struct udevice *udev)
* create only a symlink with the name as the target
* if we don't have any interesting data to remember
*/
* create only a symlink with the name as the target
* if we don't have any interesting data to remember
*/
- if (strcmp(udev->name, udev->dev->kernel) == 0 &&
- list_empty(&udev->symlink_list) && list_empty(&udev->env_list) &&
+ if (list_empty(&udev->symlink_list) && list_empty(&udev->env_list) &&
!udev->partitions && !udev->ignore_remove) {
dbg("nothing interesting to store, create symlink");
unlink(filename);
!udev->partitions && !udev->ignore_remove) {
dbg("nothing interesting to store, create symlink");
unlink(filename);
@@
-121,7
+120,7
@@
int udev_db_get_device(struct udevice *udev, const char *devpath)
struct stat stats;
char filename[PATH_SIZE];
char line[PATH_SIZE];
struct stat stats;
char filename[PATH_SIZE];
char line[PATH_SIZE];
- unsigned int maj
or, minor
;
+ unsigned int maj
, min
;
char *bufline;
char *buf;
size_t bufsize;
char *bufline;
char *buf;
size_t bufsize;
@@
-175,8
+174,8
@@
int udev_db_get_device(struct udevice *udev, const char *devpath)
count = sizeof(line);
memcpy(line, &bufline[2], count-2);
line[count-2] = '\0';
count = sizeof(line);
memcpy(line, &bufline[2], count-2);
line[count-2] = '\0';
- sscanf(line, "%u:%u", &maj
or, &minor
);
- udev->devt = makedev(maj
or, minor
);
+ sscanf(line, "%u:%u", &maj
, &min
);
+ udev->devt = makedev(maj
, min
);
break;
case 'S':
if (count > sizeof(line))
break;
case 'S':
if (count > sizeof(line))