#include <ac/socket.h>
#include <ac/string.h>
+#include <ac/ctype.h>
#include <ac/syslog.h>
#include <ac/time.h>
#include <ac/wait.h>
#include "portable.h"
+#include <stdio.h>
#include <stdlib.h>
#include <ac/ctype.h>
}
else if (pid > 0) {
/* parent - wait until the child proc is done editing */
- void (*handler)();
+ RETSIGTYPE (*handler)();
handler = SIGNAL(SIGINT, SIG_IGN);
(void) wait(&status);
(void) SIGNAL(SIGINT, handler);
#ifndef NO_TERMCAP
{
char *term;
- struct winsize win; /* for tty set-up */
if (((term = getenv("TERM")) == NULL) || (tgetent(bp, term) <= 0))
return;
else {
#ifdef TIOCGWINSZ
- if (ioctl(fileno(stdout), TIOCGWINSZ, &win) < 0) {
- lpp = tgetnum("li");
- col_size = tgetnum("co");
- } else
-#endif
- {
+ struct winsize win; /* for tty set-up */
+ if (ioctl(fileno(stdout), TIOCGWINSZ, &win) >= 0) {
if ((lpp = win.ws_row) == 0)
lpp = tgetnum("li");
if ((col_size = win.ws_col) == 0)
lpp = DEFAULT_TTY_HEIGHT;
if ((col_size <= 0) || tgetflag("hc"))
col_size = DEFAULT_TTY_WIDTH;
+ (void) SIGNAL (SIGWINCH, chwinsz);
+ } else
+#endif
+ {
+ lpp = tgetnum("li");
+ col_size = tgetnum("co");
}
}
- (void) SIGNAL (SIGWINCH, chwinsz);
-
}
#endif
}
void change_base LDAP_P(( int type, char **base, char *s ));
void initialize_client LDAP_P(( void ));
RETSIGTYPE attn LDAP_P(( int sig ));
-#ifndef NO_TERMCAP
+#if !defined(NO_TERMCAP) && defined(TIOCGWINSZ)
RETSIGTYPE chwinsz LDAP_P(( int sig ));
#endif
void
Free( void *ptr )
{
-#ifndef STDC_HEADERS
+#if 0
if (free(ptr) < 0) {
perror("free");
exit(-1);
fprintf( stderr, "usage: %s fmtstring\n", name );
}
+int
main( int argc, char **argv )
{
#ifdef notdef
#include <quipu/attr.h>
#endif
-static usage( char *name )
-{
- fprintf( stderr, "usage: %s\n", name );
-}
-
+int
main( int argc, char **argv )
{
#ifdef HAVE_PSAP_H
data.dsize = strlen( buf ) + 1;
if ( ldbm_store( db->dbc_db, key, data,
LDBM_INSERT ) != 0 ) {
- perror( "id2entry ldbm_store" );
+ fputs("id2entry ldbm_store failed\n",
+ stderr);
exit( 1 );
}
}
int St_init LDAP_P((St **st));
/* tsleep.c */
-void tsleep LDAP_P((time_t interval));
+int tsleep LDAP_P((time_t interval));
#if defined( HAVE_LWP )
void start_lwp_scheduler LDAP_P(( void ));
#endif
* Here we assume we have fully preemptive threads, and that sleep()
* does the right thing.
*/
-void
+int
tsleep(
time_t interval
)
{
sleep( interval );
+ return 0;
}
#endif /* !HAVE_LWP */