1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 08:26:52 +03:00
Commit Graph

39 Commits

Author SHA1 Message Date
kay.sievers@vrfy.org
93ca11e4be [PATCH] libsysfs: remove trailing slash on SYSFS_PATH override 2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
7e3e23925b [PATCH] remove unneeded file from libsysfs 2005-04-26 23:53:53 -07:00
kay.sievers@vrfy.org
bc68b28056 [PATCH] The path to dlist.h is not correct.
Pointed out by: Tobias Klauser <tklauser@access.unizh.ch>
2005-04-26 23:53:17 -07:00
kay.sievers@vrfy.org
138068d690 [PATCH] fix ia64 compile 2005-04-26 23:51:00 -07:00
kay.sievers@vrfy.org
5f335ca4af [PATCH] klibc_fixups: remove no longer needed stuff 2005-04-26 23:48:48 -07:00
kay.sievers@vrfy.org
733677e2c2 [PATCH] klibc_fixups: remove unneeded stuff 2005-04-26 23:48:48 -07:00
kay.sievers@vrfy.org
f385ff6512 [PATCH] big libsysfs diet (pre 2.0 version) 2005-04-26 23:36:13 -07:00
kay.sievers@vrfy.org
3f930093f9 [PATCH] libsysfs: work around a klibc bug 2005-04-26 23:36:13 -07:00
greg@bucket.kroah.org
aa7f11f470 [PATCH] fix gcc 2.96 issue in libsysfs 2005-04-26 23:21:58 -07:00
kay.sievers@vrfy.org
83c35223ed [PATCH] update libsysfs to CVS version and fix segfaulting attribute reading 2005-04-26 23:17:47 -07:00
kay.sievers@vrfy.org
993a633ab8 [PATCH] update to libsysfs 1.2.0 and add some stuff klib_fixup 2005-04-26 22:06:44 -07:00
greg@kroah.com
b19e47764c [PATCH] get rid of annoying extra lines in the syslog for some libsysfs debug messages. 2005-04-26 21:37:03 -07:00
kay.sievers@vrfy.org
e5a2989efb [PATCH] udevd race conditions and performance, assorted cleanups - take 2
here is a patch on top of your nice improvements.
I fixed the whitespace and it hopefully fixes the stupid timestamp bug in
udevd. Some stupid OS sets the hwclock to localtime and linux changes it
to UTC while starting. If any events are pending they may be delayed by
the users time distance from UTC :) So we use the uptime seconds now.
2005-04-26 21:35:13 -07:00
chris_friesen@sympatico.ca
f27125f98f [PATCH] udevd race conditions and performance, assorted cleanups
This patch covers a number of areas:

1) sysfs.h is fixed up to use the common dbg() macro.  This fixes the
case where DEBUG is defined but USE_LOG isn't.

2) udevstart.c is modified to include the proper headers, rather than
getting them indirectly which can break depending on Makefile flags

3) udevd.c gets some major changes:
a) I added a pipe from the signal handler.  This fixes the race
conditions that I mentioned earlier.  Basically, the point of the pipe
is to force the select() call to return immediately if a signal handler
fired before we actually started the select() call.  This then lets us
run the appropriate code based on flags set in the signal handler proper.
b) I added a number of flags to coalesce calls to common routines.  This
should make things slightly more efficient.
c) since most calls will tend to come in with a sequence number larger
than what has been received, I switched msg_queue_insert() to scan the
msg_list backwards to improve performance.

 filename="udevd.diff"
2005-04-26 21:35:13 -07:00
hare@suse.de
0536819cca [PATCH] fix SEGV in libsysfs/dlist.c
Hi all, Greg,

libsysfs/dlist.c: _dlist_mark_move()

is missing checks for empty lists and may (and indeed, does) crash when=20
called with empty dlists.
2005-04-26 21:35:13 -07:00
ananth@in.ibm.com
656703759d [PATCH] more Libsysfs updates
On Thu, Mar 11, 2004 at 02:36:23PM +0100, Kay Sievers wrote:
> On Thu, 2004-03-11 at 15:02, Ananth N Mavinakayanahalli wrote:
> > On Thu, Mar 11, 2004 at 02:04:36PM +0100, Kay Sievers wrote:
> > > On Thu, Mar 11, 2004 at 11:53:50AM +0500, Ananth N Mavinakayanahalli wrote:
> > >
> > > > +#define safestrcpy(to, from)	strncpy(to, from, sizeof(to)-1)
> > > > +#define safestrcat(to, from)	strncat(to, from, sizeof(to) - strlen(to)-1)
> > >
> > > These strings are not terminated with '\0' if from is longer than
> > > the sizeof to.
> >
> > Did not do it on purpose as the "to" elements are either calloc'd or memset to
> > '0' explicitly in the library. Thats the reason I mentioned "scaled down" :)
>
> Ahh, sounds good.
>
> > > > +#define safestrncpy(to, from, maxsize) \
> > > > +do { \
> > > > +	to[maxsize-1] = '\0'; \
> > > > +	strncpy(to, from, maxsize-1); \
> > > > +} while (0)
> > > > +
> > > > +#define safestrncat(to, from, maxsize) \
> > > > +do { \
> > > > +	to[maxsize-1] = '\0'; \
> > > > +	strncat(to, from, maxsize - strlen(to)-1); \
> > > > +} while (0)
> > >
> > > We all expect a similar behavior like strncat/strncpy according to the
> > > names, but these macros are limiting by the target size and do not limit
> > > the count of chars copied.
> > > This is confusing I think and suggest using a different name like
> > > 'safestrcopymax()' or something.
> >
> > Good point.. will make the change
>
> Nice. I've had these *n* names too and I forgot about the logic and only
> 10 days later I introduced a ugly bug cause I can't limit the count of
> copied chars :)

Inlined is the patch for this... applies on the earlier _BIG_ patch.
2005-04-26 21:35:09 -07:00
ananth@in.ibm.com
d1fb871d99 [PATCH] Libsysfs updates
Please find attached a _BIG_ patch to update udev's libsysfs. Patch applies
on udev-021 and contains:

1. Updates to get udev's libsysfs to the latest (to be released) level.
2. Changes for C++ compatibility (use "char" and not "unsigned char"
	unless absolutely necessary).
3. More importantly, take care of buffer overflows. Libsysfs now uses a
        scaled down version of Kay's "safe" macros.

Tested using a usb-storage device.

I will send you a doc update shortly.
2005-04-26 21:35:09 -07:00
greg@kroah.com
df41554d99 [PATCH] fix up libsysfs header file usage to fix bug reports from users that have sysfsutils installed already. 2005-04-26 21:32:29 -07:00
patmans@us.ibm.com
0bad3406c1 [PATCH] udev use new libsysfs header file location
Use the new location of libsysfs header files.
2005-04-26 21:32:29 -07:00
greg@kroah.com
a638109dfa [PATCH] mv libsysfs/libsysfs.h to libsysfs/sysfs/libsysfs.h to make it easier to use. 2005-04-26 21:32:29 -07:00
greg@kroah.com
95a6f4c8ac [PATCH] rework the logging code so that each program logs with the proper name in the syslog. 2005-04-26 21:13:20 -07:00
greg@kroah.com
bc59f0167a [PATCH] remove a __KLIBC__ tests in libsysfs, as klibc now supports getpagesize() 2005-04-26 21:13:20 -07:00
ananthmg@rediffmail.com
616a707807 [PATCH] libsysfs update for refresh + namedev.c changes
Please find inlined a patch which contains updates to libsysfs
(pre-release) for refresh and also changes to namedev.c to take
advantage of it.
2005-04-26 21:13:16 -07:00
ananth@in.ibm.com
f4f3939a6c [PATCH] change pgsize
In udev-009 and previous releases, for klibc compatibility, the pgsize var
in sysfs_read_attribute() (file sysfs_dir.c under libsysfs) is handcoded
to 0x4000.

Should it not be 4096 bytes (0x1000 in hex) instead of 0x4000 (16k bytes)?
2005-04-26 21:13:10 -07:00
dsteklof@us.ibm.com
bcbe2d8e7d [PATCH] libsysfs 0.4.0 patch
Ananth released sysfsutils 0.4.0 last night, I'm sure you saw the email.
Here's a patch with the latest changes from the pre-patch I already
gave you. It includes sysfs_get_device_parent(), which you said you
needed. I've run your test scripts and I've built scsi_id. Please
play around with this and check it out.

There are quite a few changes. Please do not access
structure pointers, like sysfs_device's parent, directly like
dev->parent. Please use the "get" function to retrieve. The functions
load things on demand and refresh views under the covers.
2005-04-26 21:13:09 -07:00
dsteklof@us.ibm.com
5d4754f195 [PATCH] pre-libsysfs-0.4.0 patch
I am sending you a pre-release patch. It's everything that's in our
current CVS tree. It adds the functionality you've been looking for. Please
play with this before checking it into your tree, I'd like to know if
it's ok with you or if you find problems. I have tested this out with
test.all and the perl regression test. Let me know what you think.

Still need to do more testing for our work and add some more functions
related to the changes.

I've gone into namedev.c and udev-add.c to make the necessary changes
in line with the library. I have not gone and edited any of the "extras".


Changes:

1) Libsysfs object structures work more as handles now, their included
directories or devices are labeled private. If you need attributes
from a sysfs_class_device, call the available function and don't access
the directory directly. Same holds true for a sysfs_class_device
sysfs_device. Do not access the link directly but call the function
sysfs_get_classdev_device() instead. We only populate entries upon
request, makes things faster and uses less memory.

2) Added sysfs_get_classdev_parent() as requested.

3) Changed getpagesize to sysconf.

4) Added sysfs_refresh_attributes function for refreshing views of
attribute lists. We still need to add refresh for links and subdirs. All
udev needs to do is keep calling sysfs_get_classdev_attr() and that will
internally call the refresh routine.
2005-04-26 21:13:07 -07:00
greg@kroah.com
a27170c49a [PATCH] fix up some duplicated function compiler warnings in libsysfs 2005-04-26 21:13:05 -07:00
dsteklof@us.ibm.com
edcd336477 [PATCH] another patch for path problem
The quick patch I sent you yesterday fixes it in one location, but
there are other points in the library that calls sysfs_get_mnt_path. We
need to address all the areas in the library where paths are used. The
following patch is a band-aid until we can get a proper path management
in the library.
2005-04-26 21:13:04 -07:00
greg@kroah.com
bc1530c65c [PATCH] Cset exclude: dsteklof@us.ibm.com|ChangeSet|20031126173159|56255 2005-04-26 21:13:04 -07:00
dsteklof@us.ibm.com
b376d32cb4 [PATCH] quick fix for libsysfs bus
There seems to be a
mismatch in udev and in libsysfs as to what to expect if the mnt point
has a slash on the end or not. If I use the included patch, it breaks
something in udev. If I patch sysfs_get_mnt_path I break udev as well
because what you're expecting. I need to sit down and go through
the library and creaate a rule as to trailing slashes. Adding the env
brought this to light.
2005-04-26 21:13:04 -07:00
dsteklof@us.ibm.com
ff44a6b0b7 [PATCH] libsysfs changes for sysfsutils 0.3.0
Here's the patch to up the library to the sysfsutils-0_3_0 level. The
following changes:

1) adds class name to sysfs_class_device structure
2) adds bus to sysfs_device
3) gets rid of code that made assumptions as to bus addresses being
unique across buses, which isn't the case.


I still owe you:

1) change getpagesize->sysconf. This is in the CVS tree and part of other
changes we're currently testing. Patch will follow.
2) you need a function to get a sysfs_class_device's parent. We hadn't
considered class devices to have parents, the one example of a multilevel
is the block class. We will add this function and send the patch to you.
2005-04-26 21:13:04 -07:00
dsteklof@us.ibm.com
8d8172514d [PATCH] patch for libsysfs sysfs directory handling
Here's a quick patch to:

1) Add an environment variable "SYSFS_PATH" that libsysfs will check
for when getting mount point before searching system's sysfs mount
point.

2) A quick fix to sysfs_get_link where the bug was.

I have tested this out with libsysfs and with udev. I couldn't test
with klibc because I haven't got the tree to build with klibc without
my changes either. I made the link but get an error finding
linux/linits.h. I will figure that out.

Please have a look at the patch. If it's agreeable, please test it. I
really want to add some generic path manipulation functions for the
sysfs_get_link error, rather than my patch's hack. But, I haven't had
time yet to do that. You really sounded like you needed this for
testing, so I'm sending it out to you. I should probably add a
function to set the env variable(?).
2005-04-26 21:06:23 -07:00
greg@kroah.com
1e959a4b05 [PATCH] klibc specific tweaks 2005-04-26 21:06:22 -07:00
greg@kroah.com
c8ba857171 [PATCH] libsysfs does not need mntent.h in it's header file. 2005-04-26 21:06:22 -07:00
greg@kroah.com
3e2677a31e [PATCH] make libsysfs spit debug messages to the same place as the rest of udev. 2005-04-26 21:05:23 -07:00
greg@kroah.com
bf0314e326 [PATCH] make libsysfs build cleanly 2005-04-26 21:05:23 -07:00
dsteklof@us.ibm.com
fe3fe3b29f [PATCH] new version of libsysfs patch
Here's the patch applying the latest libsysfs.
	- adds the latest libsysfs code to udev
		* new code includes dlist implementation, a generic linked list
			implementation. Needed our own because LGPL
		* rearranged structures
		* provided more functions for accessing directory and attributes
	- gets rid of ->directory->path references in namedev.c
	- replaces sysfs_get_value_from_attributes with sysfs_get_classdev_attr
2005-04-26 21:01:42 -07:00
lethal@linux-sh.org
b137e367bb [PATCH] udev/libsysfs cross compile fixes
I noticed that libsysfs doesn't inherently grab cross compilation arguments
that are set in the top-level Makefile, so I've come up with the following
patch to fix this. With the patch, I can succesfully cross compile for other
architectures (such as sh) by doing 'make ARCH=sh CROSS=sh-linux-' in the
top-level directory.
2005-04-26 21:01:40 -07:00
greg@kroah.com
070f54223f [PATCH] added libsysfs code from sysutils-0.1.1-071803 release 2005-04-26 21:01:39 -07:00