1
0
Fork 0

fixes to allow SunOS compilation

This commit is contained in:
bagyenda 2007-12-21 10:14:08 +00:00
parent 15888c94ca
commit a49d02b4e8
6 changed files with 38 additions and 7 deletions

View File

@ -1,3 +1,5 @@
2007-12-21 P. A. Bagyenda <bagyenda@dsmagic.com>
* Patches to permit compiling on SunOS
2007-12-15 P. A. Bagyenda <bagyenda@dsmagic.com>
* Added allowed-sender-prefix/denied-sender-prefix for mmsc group of mmsbox config
* Added allowed-receiver-prefix/denied-receiver-prefix to mms-service group of mmsbox config

View File

@ -70,8 +70,8 @@ dnl Change a few things (a la kannel config)
EXE_EXT=""
LIB_EXT="a"
case "$host" in
*-sun-solaris*)
CFLAGS="$CFLAGS -DSunOS=1"
*-sun-solaris* | *SunOS*)
CFLAGS="$CFLAGS -DSunOS=1 -D_POSIX_PTHREAD_SEMANTICS"
;;
*-cygwin*)
EXE_EXT=".exe"
@ -280,7 +280,7 @@ cat<<X
License:
Mbuni (version $M_VERSION) - Open Source MMS Gateway - http://www.mbuni.org/
Copyright (C) 2003 - 2007, Digital Solutions Ltd. - http://www.dsmagic.com
Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
This program is free software, distributed under the terms of
the GNU General Public License, with a few exceptions granted (see LICENSE)

View File

@ -19,7 +19,10 @@
#include <sys/stat.h>
#include <unistd.h>
#include <ctype.h>
#ifdef SunOS
#include <strings.h>
#include <fcntl.h>
#endif
#include <dirent.h>
#include "mms_queue.h"

View File

@ -18,6 +18,10 @@
#include <dlfcn.h>
#include <strings.h>
#ifdef SunOS
#include <fcntl.h>
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -817,10 +821,22 @@ void mms_log(char *logmsg, Octstr *from, List *to,
static int lockfile(int fd, int shouldblock)
{
int n, stop;
#ifdef SunOS
int flg = shouldblock ? F_SETLKW : F_SETLK;
flock_t lock;
#else
unsigned flg = shouldblock ? 0 : LOCK_NB;
#endif
do {
n = flock(fd, LOCK_EX|flg);
#ifdef SunOS
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 0;
lock.l_type = F_WRLCK;
n = fcntl(fd, flg, &lock);
#else
n = flock(fd, LOCK_EX|flg);
#endif
if (n < 0) {
if (errno == EINTR)
stop = 0;

View File

@ -3,7 +3,7 @@
*
* MMSBox Dlr: Dlr storage for MMSBox
*
* Copyright (C) 2003 - 2005, Digital Solutions Ltd. - http://www.dsmagic.com
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
*
* Paul Bagyenda <bagyenda@dsmagic.com>
*
@ -17,6 +17,10 @@
#include <errno.h>
#include <dlfcn.h>
#ifdef SunOS
#include <fcntl.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

View File

@ -16,6 +16,12 @@
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#ifdef SunOS
#include <strings.h>
#include <fcntl.h>
#endif
#include "mms_queue.h"
#include "mms_uaprof.h"
#include "mmsbox.h"