From adb436f93678c00fbe6b201bfcead09cf426e5f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Tue, 15 Apr 2008 11:35:14 +0000 Subject: [PATCH] Removed glite_jppsbe_readline (fixes build of jp.index). Comments in YAIM. Warning in DB module. --- org.glite.jp.common/interface/backend.h | 7 -- org.glite.jp.common/src/utils.c | 76 ---------------------- org.glite.jp.index/config/defaults/glite-jpis.pre | 2 +- .../config/functions/config_glite_jpis | 40 ++++++++++-- org.glite.lbjp-common.db/src/db.c | 3 + 5 files changed, 40 insertions(+), 88 deletions(-) diff --git a/org.glite.jp.common/interface/backend.h b/org.glite.jp.common/interface/backend.h index 69754ae..3c8c1da 100644 --- a/org.glite.jp.common/interface/backend.h +++ b/org.glite.jp.common/interface/backend.h @@ -102,13 +102,6 @@ int glite_jppsbe_query( ) ); -int glite_jppsbe_readline( - glite_jp_context_t ctx, - void *handle, - void **b, - char **line -); - char* glite_jpps_get_namespace( const char* attr ); diff --git a/org.glite.jp.common/src/utils.c b/org.glite.jp.common/src/utils.c index 6814705..a931d3f 100644 --- a/org.glite.jp.common/src/utils.c +++ b/org.glite.jp.common/src/utils.c @@ -50,82 +50,6 @@ int check_realloc_line(char **line, size_t *maxlen, size_t len) { return 1; } -/* - * read next line from stream - * - * \return error code - */ -int glite_jppsbe_readline( - glite_jp_context_t ctx, - void *handle, - void **b, - char **line -) -{ - size_t maxlen, len, i; - ssize_t nbytes; - int retval, z, end; - rl_buffer_t *buffer; - - if (!*b) *b = calloc(1,sizeof *buffer); - buffer = *b; - - maxlen = BUFSIZ; - i = 0; - len = 0; - *line = malloc(maxlen); - end = 0; - - do { - /* read next portion */ - if (buffer->pos >= buffer->size) { - buffer->pos = 0; - buffer->size = 0; - if ((retval = glite_jppsbe_pread(ctx, handle, buffer->buf, BUFSIZ, buffer->offset, &nbytes)) == 0) { - if (nbytes < 0) { - retval = EINVAL; - goto fail; - } else { - if (nbytes) { - buffer->size = (size_t)nbytes; - buffer->offset += nbytes; - } else end = 1; - } - } else goto fail; - } - - /* we have buffer->size - buffer->pos bytes */ - i = buffer->pos; - do { - if (i >= buffer->size) z = '\0'; - else { - z = buffer->buf[i]; - if (z == '\n') z = '\0'; - } - len++; - - if (!check_realloc_line(line, &maxlen, len)) { - retval = ENOMEM; - goto fail; - } - (*line)[len - 1] = z; - i++; - } while (z && i < buffer->size); - buffer->pos = i; - } while (len && (*line)[len - 1] != '\0'); - - if ((!len || !(*line)[0]) && end) { - free(*line); - *line = NULL; - } - - return 0; - -fail: - free(*line); - *line = NULL; - return retval; -} char* glite_jpps_get_namespace(const char* attr){ char* namespace = strdup(attr); diff --git a/org.glite.jp.index/config/defaults/glite-jpis.pre b/org.glite.jp.index/config/defaults/glite-jpis.pre index 5a57019..0bb7e71 100644 --- a/org.glite.jp.index/config/defaults/glite-jpis.pre +++ b/org.glite.jp.index/config/defaults/glite-jpis.pre @@ -1,2 +1,2 @@ -### Default values to some glite-LB variables +### Default values to some glite-JPIS variables GLITE_USER=glite diff --git a/org.glite.jp.index/config/functions/config_glite_jpis b/org.glite.jp.index/config/functions/config_glite_jpis index 1ea0021..d88af86 100644 --- a/org.glite.jp.index/config/functions/config_glite_jpis +++ b/org.glite.jp.index/config/functions/config_glite_jpis @@ -1,3 +1,35 @@ +############################################################################## +# Copyright (c) Members of the EGEE Collaboration. 2004. +# See http://www.eu-egee.org/partners/ for details on the copyright +# holders. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS +# OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################## +# +# NAME : config_jpis +# +# DESCRIPTION : This function configures Job Provenance Index Server. +# +# AUTHORS : LB/JP team, heavily based on glite-yaim-lb +# +# NOTES : +# +# YAIM MODULE: glite-yaim-jpis +# +############################################################################## + + function config_glite_jpis_check(){ requires MYSQL_PASSWORD } @@ -18,9 +50,9 @@ function config_glite_jpis_setenv(){ function config_glite_jpis() { - ############################################# - # Logging and Bookkeeping configuration # - ############################################# + ################################################# + # Job Provenance Index Server configuration # + ################################################# HOSTNAME=`hostname -f` @@ -68,7 +100,7 @@ function config_glite_jpis() { fi GLITE_LOCATION_VAR=${GLITE_LOCATION_VAR:-/var/glite} - mkdir -p $GLITE_LOCATION_VAR # Needed to store PID of LB server + mkdir -p $GLITE_LOCATION_VAR # Needed to store PID of JP IS server chown $GLITE_USER:$GLITE_USER $GLITE_LOCATION_VAR chmod 0755 $GLITE_LOCATION_VAR diff --git a/org.glite.lbjp-common.db/src/db.c b/org.glite.lbjp-common.db/src/db.c index 66816a1..0727f68 100644 --- a/org.glite.lbjp-common.db/src/db.c +++ b/org.glite.lbjp-common.db/src/db.c @@ -1,6 +1,9 @@ #ident "$Header$" #include +#ifdef LBS_DB_PROFILE +#include +#endif #include #include #include -- 1.8.2.3