Changeset - c2dcea315991
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-07-30 18:16:46

Fixed some warnings
1 file changed with 3 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -31,27 +31,25 @@
 
#include "protocol.h"
 
#include "options.h" // Confuse, etc.
 
#include "slavefuncs.h" // Slave functions
 
#include <string.h>
 
#include <stdio.h>
 
#include <unistd.h>
 

	
 
int slavestatus = 0; // Ugh global vars
 

	
 
int main(int argc, char *argv[])
 
{
 

	
 
int jobnum;
 
char *jobname;
 
int framenum;
 

	
 
int counter;
 

	
 
/* Parses arguments, skips if there are no args */
 
for(counter=0; counter<argc; counter++){
 
	if(strcmp(argv[counter], "-h") == 0) {
 
		fprintf(stderr, "Usage: distrenslave [option] <username> <emailaddr>\nStarts a distren slave\n\t-h\tshow this help\n\t-c\tregisters a user with [username] and [emailaddr] \n");
 
		return 2;
 
	}
 
}
 
	if(argc>1
 
		&& (strcmp("-c", argv[1]) == 0))
 
	{
 
@@ -93,27 +91,27 @@ cfg_t * my_cfg;
 
cfg_opt_t myopts[] = {
 
		CFG_SIMPLE_STR("username", &username),
 
		CFG_SIMPLE_STR("key", &key),
 
		CFG_END()
 
		};
 
struct options_common *commonopts;
 
options_init(argc,argv,&my_cfg, myopts, "slave", &commonopts);
 
/* End option getter */
 

	
 

	
 
/* If there's no key or username in the conf, or if they're at the default (!key/!username) let the user know! */
 
	if(key == NULL || username == NULL || strcmp(key, "!key") == 0 || strcmp(username, "!username") == 0 ){
 
	  fprintf(stderr, "\nYou didn't register!\nPlease register or edit your config. (see -h)\nIf this error persists, check distrenslave.conf to ensure all items are filled.\n", argv[0]);
 
	  fprintf(stderr, "\nYou didn't register!\nPlease register or edit your config. (see -h)\nIf this error persists, check distrenslave.conf to ensure all items are filled.\n");
 
	}
 
	else if(key != NULL && username != NULL || key != "!key" && username != "username" ){
 
	else if((key != NULL && username != NULL) || (key != "!key" && username != "username") ){
 
		fprintf(stderr, "Your username is %s, and your key is %s.\n",username, key);
 
		// Logs ya in:
 
		if(login_user(username) == 1){
 
			fprintf(stderr,"You should now be logged into distren.\n");
 
		}
 
		else{
 
			fprintf(stderr,"Login failed. I have no clue why. Goodbye.\n");
 
			return 0;
 
		}
 
	}
 
	else{
 
	  fprintf(stderr,"Something is terribly wrong!!!");
0 comments (0 inline, 0 general)