- proper inicialization
authorMiloš Mulač <mulac@civ.zcu.cz>
Fri, 12 May 2006 09:55:23 +0000 (09:55 +0000)
committerMiloš Mulač <mulac@civ.zcu.cz>
Fri, 12 May 2006 09:55:23 +0000 (09:55 +0000)
- require user proxy

org.glite.jp.client/examples/jpps_upload_files.c

index 3e5da0b..f33b656 100644 (file)
@@ -23,8 +23,8 @@ int main(int argc, char **argv)
 {
        glite_jpcl_context_t    ctx;
        char                              **files,
-                                                  *jobid,
-                                                  *proxy,
+                                                  *jobid = NULL,
+                                                  *proxy = NULL,
                                                   *lbmd = NULL,
                                                   *jpps = NULL;
        int                                             i, j;
@@ -46,6 +46,11 @@ int main(int argc, char **argv)
 
        if ( i >= argc ) { usage(); return 1; }
 
+       if ( !proxy && !(proxy = getenv("X509_USER_PROXY")) ) {
+               perror("-p or X509_USER_PROXY must be set!\n");
+               return 1;
+       }
+
        if ( !(files = calloc(argc-i+1, sizeof(*files))) ) {
                perror("calloc()");
                return 1;