From caedfce7b706f82a157a937f5ece3735e2e6fb5b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Fri, 23 Mar 2007 13:32:01 +0000 Subject: [PATCH] *** empty log message *** --- org.glite.lb.client/Makefile | 32 +++++++---------- org.glite.lb.client/build.xml | 7 ++++ org.glite.lb.client/examples/gen_begin | 2 +- org.glite.lb.client/examples/job_status.c | 11 +++--- .../project/configure.properties.xml | 10 +++++- org.glite.lb.client/src/prod_proto.c | 41 +++++++++++++++------- 6 files changed, 65 insertions(+), 38 deletions(-) diff --git a/org.glite.lb.client/Makefile b/org.glite.lb.client/Makefile index ba07885..a49d050 100644 --- a/org.glite.lb.client/Makefile +++ b/org.glite.lb.client/Makefile @@ -1,31 +1,32 @@ # Default values top_srcdir=. -builddir=build -top_builddir=${top_srcdir}/${builddir} stagedir=. distdir=. globalprefix=glite lbprefix=lb package=glite-lb-client version=0.0.0 -PREFIX=/opt/glite glite_location=/opt/glite globus_prefix=/opt/globus nothrflavour=gcc32 thrflavour=gcc32pthr + CC:=gcc CXX:=g++ -include Makefile.inc -include ../project/version.properties +PREFIX?=${glite_location} + version=${module.version} VPATH=${top_srcdir}/src:${top_srcdir}/test:${top_srcdir}/examples:${top_srcdir}/doc AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3 GENSAM=${top_srcdir}/examples/gen_sample_job +CHECK_VERSION:=VERSION=${version} VERSION_AHEAD=0 perl ${top_srcdir}/project/check_version.pl SUFFIXES = .T .l @@ -145,37 +146,37 @@ MAN = $(MAN_GZ:.gz=) # version_info=-version-info `echo ${version} | cut -d. -f1,2 | tr . :` -# counted minor versions: 2.1 -offset=1 +# counted minor versions: +offset=0 version_info:=-version-info ${shell \ perl -e '$$,=":"; @F=split "\\.","${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' } ${LIB}: ${LIBOBJS} - ${LINK} ${version_info} -o $@ ${LIBLOBJS} -rpath ${glite_location}/lib \ + ${LINK} ${version_info} -o $@ ${LIBLOBJS} -rpath ${PREFIX}/lib \ ${COMMON_LIB} \ -lglite_security_gss_${nothrflavour} ${THRLIB}: ${LIBTHROBJS} - ${LINK} ${version_info} -o $@ ${LIBTHRLOBJS} -rpath ${glite_location}/lib \ + ${LINK} ${version_info} -o $@ ${LIBTHRLOBJS} -rpath ${PREFIX}/lib \ ${COMMON_LIB_THR} \ -lglite_security_gss_${thrflavour} ${FAKELIB}: ${FAKELIBOBJS} - ${LINK} ${version_info} -o $@ ${FAKELIBLOBJS} -rpath ${glite_location}/lib \ + ${LINK} ${version_info} -o $@ ${FAKELIBLOBJS} -rpath ${PREFIX}/lib \ ${COMMON_LIB} \ -lglite_security_gss_${nothrflavour} ${FAKETHRLIB}: ${FAKELIBTHROBJS} - ${LINK} ${version_info} -o $@ ${FAKELIBTHRLOBJS} -rpath ${glite_location}/lib \ + ${LINK} ${version_info} -o $@ ${FAKELIBTHRLOBJS} -rpath ${PREFIX}/lib \ ${COMMON_LIB_THR} \ -lglite_security_gss_${thrflavour} ${PLUSLIB}: ${PLUSOBJS} - ${LINK} ${version_info} -o $@ ${PLUSLOBJS} -rpath ${glite_location}/lib ${LIB} + ${LINK} ${version_info} -o $@ ${PLUSLOBJS} -rpath ${PREFIX}/lib ${LIB} ${THRPLUSLIB}: ${PLUSTHROBJS} - ${LINK} ${version_info} -o $@ ${PLUSTHRLOBJS} -rpath ${glite_location}/lib ${THRLIB} + ${LINK} ${version_info} -o $@ ${PLUSTHRLOBJS} -rpath ${PREFIX}/lib ${THRLIB} logevent: logevent.o args.o ${LINK} -o $@ logevent.o args.o ${LIB} ${EXT_LIB} @@ -312,13 +313,6 @@ endif clean: check_version: - @perl -ne '/#define GLITE_LB_CLIENT_INTERFACE "(\d+)\.\d+\.\d+"/; \ - $$iface=$$1; \ - $$_="${version}"; /(\d+)\.\d+\.\d+/; \ - if ($$iface != $$1) { \ - print "error: Major version of the interface ($$iface) does not match implementation ($$1)\n" ;\ - exit 1; \ - } \ - ' ${stagedir}/include/glite/lb/interface_version.h + ${CHECK_VERSION} ${stagedir}/include/glite/lb/interface_version.h .PHONY: default all compile examples fake check stage dist distsrc distbin install clean check_version diff --git a/org.glite.lb.client/build.xml b/org.glite.lb.client/build.xml index b1eb812..60d35dc 100755 --- a/org.glite.lb.client/build.xml +++ b/org.glite.lb.client/build.xml @@ -20,6 +20,12 @@ Revision history: $Log$ + Revision 1.6.20.1 2006/09/21 13:21:40 jpospi + use check_version.pl + + Revision 1.6 2005/05/26 15:13:40 zurek + inserted module.build.file + Revision 1.5 2004/10/18 19:16:09 zsalvet RPM descriptions @@ -104,6 +110,7 @@ + diff --git a/org.glite.lb.client/examples/gen_begin b/org.glite.lb.client/examples/gen_begin index 4a0d935..67565aa 100755 --- a/org.glite.lb.client/examples/gen_begin +++ b/org.glite.lb.client/examples/gen_begin @@ -31,7 +31,7 @@ while test -n "$1" do case "$1" in "-m") shift; BKSERVER_HOST="$1" ;; - "-x") LBPROXY="-x -S $1" ;; + "-x") LBPROXY="-x" ;; "-X") shift; LBPROXY="-x"; LBPROXY_STORE_SOCK="-S $1" ;; "-j") shift; EDG_JOBID="$1" ;; "-l") shift; LARGE_STRESS="-l $1" ;; diff --git a/org.glite.lb.client/examples/job_status.c b/org.glite.lb.client/examples/job_status.c index 0a6fd6b..c38eae0 100644 --- a/org.glite.lb.client/examples/job_status.c +++ b/org.glite.lb.client/examples/job_status.c @@ -143,7 +143,7 @@ int main(int argc,char *argv[]) static void usage(char *name) { - fprintf(stderr,"Usage: %s job_id [-x lb_proxy_serve_sock] [-fasthist|-fullhist] [job_id [...]]\n", name); + fprintf(stderr,"Usage: %s [-x lb_proxy_serve_sock] [-fasthist|-fullhist] [job_id [...]]\n", name); fprintf(stderr," %s -all\n", name); } @@ -187,7 +187,7 @@ dgerr(edg_wll_Context ctx,char *where) static void printstat(edg_wll_JobStat stat, int level) { - char *s, *j, ind[10]; + char *s, *j1,*j2, ind[10]; int i; @@ -198,7 +198,7 @@ static void printstat(edg_wll_JobStat stat, int level) s = edg_wll_StatToString(stat.state); /* print whole flat structure */ printf("%sstate : %s\n", ind, s); - printf("%sjobId : %s\n", ind, j = edg_wlc_JobIdUnparse(stat.jobId)); + printf("%sjobId : %s\n", ind, j1 = edg_wlc_JobIdUnparse(stat.jobId)); printf("%sowner : %s\n", ind, stat.owner); switch (stat.jobtype) { case EDG_WLL_STAT_SIMPLE: @@ -217,7 +217,7 @@ static void printstat(edg_wll_JobStat stat, int level) break; } printf("%sparent_job : %s\n", ind, - j = edg_wlc_JobIdUnparse(stat.parent_job)); + j2 = edg_wlc_JobIdUnparse(stat.parent_job)); if (stat.jobtype) {; printf("%sseed : %s\n", ind, stat.seed); printf("%schildren_num : %d\n", ind, stat.children_num); @@ -300,7 +300,8 @@ static void printstat(edg_wll_JobStat stat, int level) printf("\n"); - free(j); + free(j1); + free(j2); free(s); } diff --git a/org.glite.lb.client/project/configure.properties.xml b/org.glite.lb.client/project/configure.properties.xml index 4ca504f..f6ae77c 100644 --- a/org.glite.lb.client/project/configure.properties.xml +++ b/org.glite.lb.client/project/configure.properties.xml @@ -20,6 +20,14 @@ Revision history: $Log$ + Revision 1.8.2.1 2006/11/28 20:24:00 akrenek + PREFIX is set to stage by default + - fix build in the old glite fashion + - should not break build in etics + + Revision 1.8 2006/09/20 10:50:08 zsalvet + Remove CVS conflict section. + Revision 1.7 2006/09/19 20:27:40 akrenek Builds after merge _RC31 @@ -61,7 +69,7 @@ distdir=${dist.dir} globalprefix=${global.prefix} lbprefix=${subsystem.prefix} package=${module.package.name} -PREFIX=${install.dir} +# PREFIX=${install.dir} version=${module.version} glite_location=${with.glite.location} globus_prefix=${with.globus.prefix} diff --git a/org.glite.lb.client/src/prod_proto.c b/org.glite.lb.client/src/prod_proto.c index 31f7254..21507d7 100644 --- a/org.glite.lb.client/src/prod_proto.c +++ b/org.glite.lb.client/src/prod_proto.c @@ -28,7 +28,10 @@ static int handle_gss_failures(edg_wll_Context ctx, int code, edg_wll_GssStatus *gss_code, const char *text) { static char err[256]; - int ret = 0; + int myerrno, ret; + + myerrno = errno; + ret = 0; edg_wll_ResetError(ctx); @@ -45,8 +48,14 @@ int handle_gss_failures(edg_wll_Context ctx, int code, edg_wll_GssStatus *gss_co ret = edg_wll_SetError(ctx,ENOTCONN,err); break; case EDG_WLL_GSS_ERROR_ERRNO: - snprintf(err, sizeof(err), "%s;; GSS Error: system error occured;", text); - ret = edg_wll_SetError(ctx,ENOTCONN,err); + { + const char *msg1; + char *msg2; + msg1 = strerror(myerrno); + asprintf(&msg2, "%s;; System Error: %s", text, msg1); + ret = edg_wll_SetError(ctx,ENOTCONN,msg2); + free(msg2); + } break; case EDG_WLL_GSS_ERROR_GSS: snprintf(err, sizeof(err), "%s;; GSS Error: GSS failure occured", text); @@ -56,7 +65,7 @@ int handle_gss_failures(edg_wll_Context ctx, int code, edg_wll_GssStatus *gss_co { const char *msg1; char *msg2; - msg1 = hstrerror(errno); + msg1 = hstrerror(myerrno); asprintf(&msg2, "%s;; GSS Error: %s", text, msg1); ret = edg_wll_SetError(ctx,EDG_WLL_ERROR_DNS, msg2); free(msg2); @@ -103,8 +112,10 @@ int plain_reader(void *user_data, char *buffer, int max_len) int len; len = edg_wll_plain_read_full(data->conn, buffer, max_len, &data->ctx->p_tmp_timeout); - if(len < 0) - edg_wll_SetError(data->ctx, EDG_WLL_IL_PROTO, "plain_reader(): error reading message data"); + if(len < 0) { + edg_wll_SetError(data->ctx, errno, "edg_wll_plain_read_full()"); + edg_wll_UpdateError(data->ctx, EDG_WLL_IL_PROTO, "plain_reader(): error reading message data"); + } return(len); } @@ -165,12 +176,15 @@ int get_reply_gss(edg_wll_Context ctx, edg_wll_GssConnection *conn, char **buf, data.conn = conn; code = read_il_data(&data, &msg, gss_reader); if(code < 0) { - edg_wll_SetError(ctx, EDG_WLL_IL_PROTO, "get_reply_gss(): error reading reply"); + edg_wll_UpdateError(ctx, EDG_WLL_IL_PROTO, "get_reply_gss(): error reading reply"); goto get_reply_gss_end; } if(decode_il_reply(code_maj, code_min, buf, msg) < 0) { - edg_wll_SetError(ctx, EDG_WLL_IL_PROTO, "get_reply_gss(): error decoding reply"); + char *et; + asprintf(&et,"get_reply_gss(): error decoding reply \"%s\"", msg); + edg_wll_UpdateError(ctx, EDG_WLL_IL_PROTO, et); + if (et) free(et); goto get_reply_gss_end; } @@ -504,7 +518,8 @@ int edg_wll_log_proxy_write(edg_wll_Context ctx, edg_wll_PlainConnection *conn, len = encode_il_msg(&buffer, &ll); } if(len < 0) { - edg_wll_SetError(ctx,ENOMEM,"edg_wll_log_proxy_write(): error encoding message"); + edg_wll_SetError(ctx,errno,"encode_il_msg()"); + edg_wll_UpdateError(ctx,ENOMEM,"edg_wll_log_proto_client_proxy(): error encoding message"); return -1; } @@ -512,7 +527,8 @@ int edg_wll_log_proxy_write(edg_wll_Context ctx, edg_wll_PlainConnection *conn, fprintf(stderr,"edg_wll_log_proxy_write: sending message\n"); #endif if ((count = edg_wll_plain_write_full(conn, buffer, len, &ctx->p_tmp_timeout)) < 0) { - edg_wll_SetError(ctx, EDG_WLL_IL_PROTO,"edg_wll_log_proxy_write(): error sending message to socket"); + edg_wll_SetError(ctx, errno, "edg_wll_plain_write_full()"); + edg_wll_UpdateError(ctx, EDG_WLL_IL_PROTO,"edg_wll_log_proto_client_proxy(): error sending message to socket"); return -1; } @@ -679,7 +695,8 @@ int edg_wll_log_direct_write(edg_wll_Context ctx, edg_wll_GssConnection *conn, e len = encode_il_msg(&buffer, &ll); } if(len < 0) { - edg_wll_SetError(ctx, ENOMEM, "edg_wll_log_direct_write(): error encoding message"); + edg_wll_SetError(ctx, errno, "encode_il_msg()"); + edg_wll_UpdateError(ctx, ENOMEM, "edg_wll_log_proto_client_direct(): error encoding message"); return -1; } #ifdef EDG_WLL_LOG_STUB @@ -720,7 +737,7 @@ int edg_wll_log_direct_read(edg_wll_Context ctx, edg_wll_GssConnection *con) fprintf(stderr,"edg_wll_log_direct_read: reading answer from bkserver\n"); #endif if ((err = get_reply_gss(ctx, con, &answer, &lbproto_code, &code)) != 0 ) { - edg_wll_UpdateError(ctx, EDG_WLL_IL_PROTO,"edg_wll_log_direct_read(): error reading answer from bkserver"); + edg_wll_UpdateError(ctx, EDG_WLL_IL_PROTO,"edg_wll_log_proto_client_direct(): error reading answer from L&B direct server"); if (answer) free(answer); return -1; } else { -- 1.8.2.3