-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now sends name to iRODS server. Small configuration changes.
- Loading branch information
Showing
2 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dnl -*- Autoconf -*- | ||
AC_COPYRIGHT([ | ||
Copyright (c) 2015 Genome Research Ltd. | ||
Copyright (c) 2015, 2016 Genome Research Ltd. | ||
Author: Andrew Whitwham <[email protected]> | ||
This file is part of tears. | ||
|
@@ -19,7 +19,7 @@ this program. If not, see <http://www.gnu.org/licenses>]) | |
dnl Process this file with autoconf to produce a configure script. | ||
|
||
AC_PREREQ([2.68]) | ||
AC_INIT([tears], [1.0], [[email protected]]) | ||
AC_INIT([tears], [1.1], [[email protected]]) | ||
|
||
AM_INIT_AUTOMAKE([-Wall -Werror foreign]) | ||
|
||
|
@@ -109,6 +109,7 @@ AC_RUN_IFELSE( | |
[AC_MSG_ERROR([test iRODS program failed with IRODS_HOME=${IRODS_HOME}])]) | ||
|
||
AC_CONFIG_SRCDIR([tears.c]) | ||
AC_CONFIG_HEADERS([tears_config.h]) | ||
AC_CONFIG_FILES([Makefile]) | ||
AC_OUTPUT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2015 Genome Research Ltd. | ||
* Copyright (c) 2015, 2016 Genome Research Ltd. | ||
* | ||
* Author: Andrew Whitwham <[email protected]> | ||
* | ||
|
@@ -27,6 +27,7 @@ | |
* | ||
*/ | ||
|
||
#include "tears_config.h" | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
@@ -42,7 +43,8 @@ void usage_and_exit(char *pname, int exit_code) { | |
fprintf(stderr, "\t-b bytes\tread/write buffer (default %d)\n", DEFAULT_BUFFER_SIZE); | ||
fprintf(stderr, "\t-v\t\tverbose mode\n"); | ||
fprintf(stderr, "\t-d\t\tuse default server\n"); | ||
fprintf(stderr, "\t-h\t\tprint this help\n"); | ||
fprintf(stderr, "\t-h\t\tprint this help\n\n"); | ||
fprintf(stderr, "Version: %s Author: %s\n", PACKAGE_STRING, PACKAGE_BUGREPORT ); | ||
exit(exit_code); | ||
} | ||
|
||
|
@@ -200,6 +202,7 @@ int main (int argc, char **argv) { | |
int status; | ||
char *obj_name = NULL; | ||
char *buffer; | ||
char *prog_name; | ||
size_t buf_size = DEFAULT_BUFFER_SIZE; | ||
int verbose = 0; | ||
int opt; | ||
|
@@ -251,6 +254,21 @@ int main (int argc, char **argv) { | |
error_and_exit(conn, "Error: unable to set buffer to size %ld\n", buf_size); | ||
} | ||
|
||
// set the client name so iRODS knows what program is connecting to it | ||
prog_name = strrchr(argv[0], '/'); | ||
|
||
if (!prog_name) { | ||
prog_name = argv[0]; | ||
} else { | ||
prog_name++; // don't want the actual '/' | ||
} | ||
|
||
if (verbose) { | ||
fprintf(stderr, "Setting client name to: %s\n", prog_name); | ||
} | ||
|
||
setenv(SP_OPTION, prog_name, 1); | ||
|
||
// lets get the irods environment | ||
if ((status = getRodsEnv(&irods_env)) < 0) { | ||
error_and_exit(conn, "Error: getRodsEnv failed with status %d\n", status); | ||
|