summaryrefslogtreecommitdiff
path: root/udevdb.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-02-12 22:51:44 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:32:27 -0700
commit00866ed2a1f755eb027c84827fed1ed77364d436 (patch)
treeb7687cfc1abe2ee483a0e8033f7f05f9f551b97d /udevdb.c
parentba053b91e145d7bb88bbd34856f6a6a86e3e718b (diff)
[PATCH] udev - keep private data out of the database?
Shouldn't we keep the temporary strings out of the database, or is this information useful for something? It cuts the length of the data from 628 to 275 bytes.
Diffstat (limited to 'udevdb.c')
-rw-r--r--udevdb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/udevdb.c b/udevdb.c
index c4e064fc11..e657fedcb2 100644
--- a/udevdb.c
+++ b/udevdb.c
@@ -58,8 +58,8 @@ int udevdb_add_dev(const char *path, const struct udevice *dev)
key.dsize = strlen(keystr) + 1;
data.dptr = (void *)dev;
- data.dsize = sizeof(*dev);
-
+ data.dsize = UDEVICE_LEN;
+
return tdb_store(udevdb, key, data, TDB_REPLACE);
}
@@ -77,7 +77,8 @@ int udevdb_get_dev(const char *path, struct udevice *dev)
if (data.dptr == NULL || data.dsize == 0)
return -ENODEV;
- memcpy(dev, data.dptr, sizeof(*dev));
+ memset(dev, 0, sizeof(struct udevice));
+ memcpy(dev, data.dptr, UDEVICE_LEN);
return 0;
}