test \( -z "$BKSERVER_HOST" \) -a \( -z "$EDG_JOBID" \) && usage
-if [[ $0 =~ "cream_" ]]; then TYPE=-c; fi
+if echo "$0" | grep "cream_" >/dev/null; then TYPE=-c; fi
if [ -z "$EDG_JOBID" ]
then
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/stat.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <netdb.h>
#ident "$Header$"
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/un.h>
#include <time.h>
#include <unistd.h>
#include "producer.h"
#include "connection.h"
+#if defined(FREEBSD) || defined(__FreeBSD__) && !defined(TCP_CORK)
+#define TCP_CORK TCP_NOPUSH
+#endif
+
static const char* socket_path="/tmp/lb_proxy_store.sock";
/**
#include <assert.h>
#include <errno.h>
+#if defined(FREEBSD) || defined(__FreeBSD__)
+#define TCP_CORK TCP_NOPUSH
+#endif
+
#include "glite/lbu/log.h"
#include "glite/lb/context-int.h"
#include "glite/lb/timeouts.h"
#define DEFAULT_PIDFILE "/var/glite/glite-lb-logd.pid"
+typedef void (*logd_handler_t)(int);
+
static const char rcsid[] = "@(#)$Id$";
static int debug = 0;
static int port = EDG_WLL_LOG_PORT_DEFAULT;
program_name,program_name);
}
-static sighandler_t mysignal(int num,sighandler_t handler)
+static logd_handler_t mysignal(int num,logd_handler_t handler)
{
struct sigaction sa,osa;
#include <string.h>
#include <unistd.h>
#include <getopt.h>
-#include <linux/limits.h>
+#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
if (ctx->dbctx) {
code = glite_lbu_DBError(ctx->dbctx, NULL, &ed);
- if (code == EDEADLOCK) code = EDG_WLL_ERROR_DB_TRANS_DEADLOCK;
- if (code == ERESTART) code = EDG_WLL_ERROR_DB_LOST_CONNECTION;
+ if (code == EDEADLK) code = EDG_WLL_ERROR_DB_TRANS_DEADLOCK;
+ if (code == ENOTCONN) code = EDG_WLL_ERROR_DB_LOST_CONNECTION;
edg_wll_SetError(ctx, code, ed);
free(ed);
} else {
#ident "$Header$"
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#include <glite/security/lcas/lcas_modules.h>
static char *modname = "lcas_lb";
/* save jobid-userid relation into jobs table */
if ((err = store_job(ctx, subjobs[i], userid, proxy, server, 0, 0)))
- if (edg_wll_Error(ctx,&et,&ed) == EDEADLOCK) goto err;
+ if (edg_wll_Error(ctx,&et,&ed) == EDEADLK) goto err;
/* interchange variable parts (jobids) in values */
/* there are only two occurences of subjob jobid */
#include <sys/file.h>
#include <sys/socket.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <sys/un.h>
#include <sys/uio.h>
#include <errno.h>
+#include <string.h>
#include <cclassad.h>
#include <stdio.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <unistd.h>
#include "glite/lbu/trio.h"
@@@LANG: C
#include <stdio.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <unistd.h>
#include "glite/lbu/trio.h"
#include <string.h>
#include <errno.h>
#include <stdio.h>
+#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <dlfcn.h>
-#include <malloc.h>
#include <unistd.h>
#include <getopt.h>
#include <sys/stat.h>
DEBUG:=-g -O0 -W -Wall
+os=${shell uname}
+DL_LIBS:=
+ifeq (${os},Linux)
+ DL_LIBS:=-ldl
+endif
+
MYSQL_SONAME:=$(shell ../project/get_soname.sh mysqlclient ${mysql-devel_prefix}/${libdir} ${mysql_prefix}/${libdir} ${mysql-devel_prefix}/lib ${mysql_prefix}/lib)
PSQL_SONAME:=$(shell ../project/get_soname.sh pq ${postgresql_prefix}/${libdir} ${postgresql_prefix}/lib)
LINK:=libtool --mode=link ${CC} -rpath ${stagedir}/lib ${LDFLAGS}
INSTALL:=libtool --mode=install install
-EXT_LIBS:=-lglite_lbu_trio -lpthread -ldl
+EXT_LIBS:=-lglite_lbu_trio -lpthread ${DL_LIBS}
TESTOBJS:=${OBJS} dbtest.o
OBJS:=${OBJS} db.o
HDRS:=db.h
size_t i,j,ret;
/* XXX: "show index from" columns. Matches at least MySQL 4.0.11 */
- char *sql, *showcol[12];
+ char *sql, *showcol[13];
int Key_name,Seq_in_index,Column_name,Sub_part;
char **keys = NULL;
case CR_SERVER_LOST:
case CR_SERVER_GONE_ERROR:
if (ctx->in_transaction) {
- ERR(ctx, ERESTART, mysql_module.mysql_error(ctx->mysql));
+ ERR(ctx, ENOTCONN, mysql_module.mysql_error(ctx->mysql));
return -1;
}
else if (retry_nr <= 0)
do_reconnect = 1;
break;
case ER_LOCK_DEADLOCK:
- ERR(ctx, EDEADLOCK, mysql_module.mysql_error(ctx->mysql));
+ ERR(ctx, EDEADLK, mysql_module.mysql_error(ctx->mysql));
return -1;
break;
default:
#ifndef GLITE_LBU_MAILDIR_H
#define GLITE_LBU_MAILDIR_H
+#include <time.h>
+
/*
* Functions for reading and writing messages via
* maildir protocol.
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
+#include <limits.h>
#include <time.h>
#include <fcntl.h>
#include <sys/time.h>
} else {
pidfile = strdup(custom_pidfile);
}
- setpgrp(); /* needs for signalling */
+ setpgid(0, 0); /* needs for signalling */
master = getpid();
fpid = fopen(pidfile,"r");
if ( fpid )
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
-# define HAVE_STRTOD_L
-# define HAVE_SSCANF_L
-# define HAVE_SPRINTF_L
+//# define HAVE_STRTOD_L
+//# define HAVE_SSCANF_L
+//# define HAVE_SPRINTF_L
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_STRTOLL