[Date Prev][Date Next] [Chronological] [Thread] [Top]

OpenLDAP-1.1alpha bugs and patch



Hi,

two further bugs in OpenLDAP-1.1alpha, exposed on i386-solaris2.5.1:

1. servers/slapd/lock.c wont compile because incorrect conditional
  caused use of `flock' and accompagnying defines instead of `lockf'
  I changed the conditional from `USE_LOCKF' to `HAVE_LOCKF'

2. clients/ud/main.c wont compile because it is missing termios types
  and defines. This is because Solaris has both `termios.h' and
  `sys/sgtty.h'. The relevant types and defines reside in `termios.h'
  only. I changed the conditional in `include/ac/termios.h' so that
  use of `termios.h' is preferred over `sys/sgtty.h' if both are
  present. Additionally i defined NO_TERMCAP. This may be wrong,
  correct this if necessary.

There is also the problem that the thread library cannot be
autodetected because Solaris 2.5.1 has neither a working `sched_yield'
nor `pthread_yield' (though there is a `sched_yield'-stub in
libposix4). The content of the file `thread.c' indicates that someone
is working on the problem. Should i do something on my own?

The following patch fixes the bugs mentioned above and the
configuration bug regarding `sys/filio' reported earlier.



1998-11-04  Jorg Pietschmann  <pietsch@swissline.ch>

	* termios.h: reorder conditionals, prefer termios.h over
	sys/sgtty.h
	* servers/slapd/lock.c (lock_fclose): conditional changed
	from USE_LOCKF to HAVE_LOCKF.
	* configure.in: check for sys/filio.h instead of fileio.h.



diff -cr ldap/configure.in ldap.new/configure.in
*** ldap/configure.in	Tue Oct 27 23:43:07 1998
--- ldap.new/configure.in	Tue Nov  3 23:09:32 1998
***************
*** 694,700 ****
  	stddef.h		\
  	errno.h			\
  	fcntl.h			\
! 	filio.h			\
  	getopt.h		\
  	limits.h		\
  	malloc.h		\
--- 694,700 ----
  	stddef.h		\
  	errno.h			\
  	fcntl.h			\
! 	sys/filio.h			\
  	getopt.h		\
  	limits.h		\
  	malloc.h		\
diff -cr ldap/servers/slapd/lock.c ldap.new/servers/slapd/lock.c
*** ldap/servers/slapd/lock.c	Sun Oct 25 01:42:00 1998
--- ldap.new/servers/slapd/lock.c	Wed Nov  4 20:22:36 1998
***************
*** 53,59 ****
  lock_fclose( FILE *fp, FILE *lfp )
  {
  	/* unlock */
! #ifdef USE_LOCKF
  	lockf( fileno( lfp ), F_ULOCK, 0 );
  #else
  	flock( fileno( lfp ), LOCK_UN );
--- 53,59 ----
  lock_fclose( FILE *fp, FILE *lfp )
  {
  	/* unlock */
! #ifdef HAVE_LOCKF
  	lockf( fileno( lfp ), F_ULOCK, 0 );
  #else
  	flock( fileno( lfp ), LOCK_UN );
diff -cr ldap/include/ac/termios.h ldap.new/include/ac/termios.h
*** ldap/include/ac/termios.h	Sun Oct 25 01:41:53 1998
--- ldap.new/include/ac/termios.h	Wed Nov  4 21:22:09 1998
***************
*** 3,9 ****
  #ifndef _AC_TERMIOS_H
  #define _AC_TERMIOS_H
  
! #ifdef HAVE_SGTTY_H
  #include <sgtty.h>
  
  #ifdef HAVE_SYS_IOCTL_H
--- 3,23 ----
  #ifndef _AC_TERMIOS_H
  #define _AC_TERMIOS_H
  
! #ifdef HAVE_TERMIOS_H
! #include <termios.h>
! 
! #define TERMIO_TYPE	struct termios
! #define TERMFLAG_TYPE	tcflag_t
! #define GETATTR( fd, tiop )	tcgetattr((fd), (tiop))
! #define SETATTR( fd, tiop )	tcsetattr((fd), TCSANOW /* 0 */, (tiop))
! #define GETFLAGS( tio )		((tio).c_lflag)
! #define SETFLAGS( tio, flags )	((tio).c_lflag = (flags))
! 
! #elif  defined(HAVE_SGTTY_H)
! #ifndef NO_TERMCAP
! #define NO_TERMCAP 1
! #endif
! 
  #include <sgtty.h>
  
  #ifdef HAVE_SYS_IOCTL_H
***************
*** 16,32 ****
  #define SETATTR( fd, tiop )	ioctl((fd), TIOCSETP, (caddr_t)(tiop))
  #define GETFLAGS( tio )     ((tio).sg_flags)
  #define SETFLAGS( tio, flags )  ((tio).sg_flags = (flags))
- 
- #elif HAVE_TERMIOS_H
- #include <termios.h>
- 
- #define TERMIO_TYPE	struct termios
- #define TERMFLAG_TYPE	tcflag_t
- #define GETATTR( fd, tiop )	tcgetattr((fd), (tiop))
- #define SETATTR( fd, tiop )	tcsetattr((fd), TCSANOW /* 0 */, (tiop))
- #define GETFLAGS( tio )		((tio).c_lflag)
- #define SETFLAGS( tio, flags )	((tio).c_lflag = (flags))
- 
  #endif /* HAVE_TERMIOS_H */
  
  #endif /* _AC_TERMIOS_H */
--- 30,35 ----