[Libsysio-commit] HEAD: libsysio/dev/stdfd stdfd.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2008-06-17 15:10:42
|
Update of /cvsroot/libsysio/libsysio/dev/stdfd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29665 Modified Files: stdfd.c Log Message: Fixed bug in _sysio_stdfd_init. It was returning the major number. That happened to be zero but could be anything in [0,127]. Any other number is interpreted by the caller as an error. Index: stdfd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/stdfd.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- stdfd.c 25 Jan 2005 00:36:46 -0000 1.14 +++ stdfd.c 17 Jun 2008 15:10:39 -0000 1.15 @@ -91,6 +91,7 @@ int _sysio_stdfd_init() { struct inode_ops stdfd_operations; + int mjr; stdfd_operations = _sysio_nodev_ops; stdfd_operations.inop_open = stdfd_open; @@ -102,9 +103,13 @@ _sysio_stdfd_init() stdfd_operations.inop_datasync = stdfd_datasync; stdfd_operations.inop_ioctl = stdfd_ioctl; - return _sysio_char_dev_register(SYSIO_C_STDFD_MAJOR, + mjr = + _sysio_char_dev_register(SYSIO_C_STDFD_MAJOR, "stdfd", &stdfd_operations); + if (mjr >= 0) + mjr = 0; + return mjr; } static int |