Fixes for OpenBSD

This commit is contained in:
Ulrich Wilkens
2018-06-01 03:29:42 +02:00
committed by Jon Trulson
parent 07f272122d
commit 885b65a09a
11 changed files with 42 additions and 31 deletions

View File

@@ -103,6 +103,7 @@ static int write_map_window(
*/
static char *Includes[] =
{
"<stdint.h>",
"<unistd.h>",
"<stdlib.h>",
"<stdio.h>",
@@ -542,7 +543,7 @@ write_main(GenCodeInfo genCodeInfo, ABObj project)
/*
* Local variables
*/
abio_puts(codeFile, "Widget\t\ttoplevel = 0;\n");
abio_puts(codeFile, "Widget\t\ttoplevel = (Widget)NULL;\n");
abio_puts(codeFile, "Display\t\t*display = (Display*)NULL;\n");
abio_puts(codeFile, "XtAppContext\tapp = (XtAppContext)NULL;\n");
abio_puts(codeFile, "String\t\t*fallback_resources = (String*)NULL;\n");
@@ -673,7 +674,7 @@ write_main(GenCodeInfo genCodeInfo, ABObj project)
{
abmfP_write_c_comment(genCodeInfo, FALSE,
"Set up the application's root window.");
abio_printf(codeFile, "%s = toplevel;\n",
abio_printf(codeFile, "%s = toplevel;\n\n",
abmfP_get_c_name_global(main_window));
if (obj_get_icon(main_window) != NULL)

View File

@@ -483,7 +483,7 @@ char *partype(n)
void srefout(M_NOPAR)
{
LOGICAL first = TRUE ;
int *mapbysref ;
int *mapbysref = NULL ;
SREFSTRUCT *srefp ;
SREFDATA *data ;
int count = 0 ;

View File

@@ -29,6 +29,8 @@ This product and information is proprietary of Tandem Computers Incorporated.
/* End.c executes end-code specified in the interface. */
#include <stdint.h>
#include "userinc.h"
#include "globdec.h"

View File

@@ -1,6 +1,6 @@
hdr,sys poll,socket,netinet/in
lib select,poll,socket
typ fd_set sys/socket.h
typ fd_set sys/socket.h sys/select.h
cat{
#pragma prototyped
#ifdef _lib_poll

View File

@@ -1,6 +1,6 @@
hdr,sys poll,socket,netinet/in
lib select,poll,socket
typ fd_set sys/socket.h
typ fd_set sys/socket.h sys/select.h
cat{
#pragma prototyped
#ifdef _lib_poll

View File

@@ -1956,6 +1956,13 @@ Authenticate( struct display *d, char *name, char *passwd, char **msg )
}
#endif
#if defined(__OpenBSD__) && OSMAJORVERSION > 5
/*
* Use the OpenBSD getpwnam_shadow function to get the crypt()ed password
*/
p = getpwnam_shadow(name);
#endif
if (!p || strlen(name) == 0 ||
strcmp (crypt (passwd, p->pw_passwd), p->pw_passwd)) {

View File

@@ -48,7 +48,7 @@
#include <stdio.h>
#include <stdarg.h>
#if defined(sun) || defined(__FreeBSD__)
#if defined(sun) || defined(CSRG_BASED)
#include <iconv.h>
#endif
#include <sys/stat.h>
@@ -931,7 +931,7 @@ friend class Session;
DTMailError_t minor_code);
};
#if defined(sun) || defined(__FreeBSD__)
#if defined(sun) || defined(CSRG_BASED)
template <typename T>
size_t iconv (iconv_t i, const T inbuf, size_t* inleft,
char** outbuf, size_t* outleft)

View File

@@ -1799,7 +1799,12 @@ localAuthenticate(
/*
* Get password entry for 'name' or 'uid'.
*/
#if defined(__OpenBSD__) && OSMAJORVERSION > 5
if ((pwent = (name == NULL ?
getpwuid_shadow(uid) : getpwnam_shadow(name))) == NULL)
#else
if ((pwent = (name == NULL ? getpwuid(uid) : getpwnam(name))) == NULL)
#endif
{
/*
* Can't get entry.