Makefile.in: Added maintainer mode fixes.
[samba.git] / source3 / client / client.c
index 6d9482ff28ebda0d60cfb79c4f36f549d1a78066..8d6e8a4b3c90c406f9e9c23c5ea6d55747bc5182 100644 (file)
@@ -496,7 +496,7 @@ static void do_get(char *rname,char *lname)
        if(!strcmp(lname,"-")) {
                handle = fileno(stdout);
        } else {
-               handle = open(lname,O_WRONLY|O_CREAT|O_TRUNC,0644);
+               handle = sys_open(lname,O_WRONLY|O_CREAT|O_TRUNC,0644);
                newhandle = True;
        }
        if (handle < 0) {
@@ -632,7 +632,7 @@ static void do_mget(file_info *finfo)
        if (lowercase)
                strlower(finfo->name);
        
-       if (!directory_exist(finfo->name,NULL) && 
+       if (!dos_directory_exist(finfo->name,NULL) && 
            dos_mkdir(finfo->name,0777) != 0) {
                DEBUG(0,("failed to create directory %s\n",CNV_LANG(finfo->name)));
                pstrcpy(cur_dir,saved_curdir);
@@ -818,7 +818,7 @@ static void do_put(char *rname,char *lname)
                f = stdin;
                /* size of file is not known */
        } else {
-               f = fopen(lname,"r");
+               f = sys_fopen(lname,"r");
        }
 
        if (!f) {
@@ -982,7 +982,7 @@ static void cmd_mput(void)
                                 "/bin/ls %s > %s",p,tmpname);
                system(cmd);
 
-               f = fopen(tmpname,"r");
+               f = sys_fopen(tmpname,"r");
                if (!f) continue;
                
                while (!feof(f)) {
@@ -1321,8 +1321,8 @@ static void cmd_lcd(void)
        pstring d;
        
        if (next_token(NULL,buf,NULL,sizeof(buf)))
-               dos_chdir(buf);
-       DEBUG(2,("the local directory is now %s\n",GetWd(d)));
+               chdir(buf);
+       DEBUG(2,("the local directory is now %s\n",sys_getwd(d)));
 }
 
 /****************************************************************************
@@ -1718,7 +1718,6 @@ struct cli_state *do_connect(char *server, char *share)
 static BOOL process(char *base_directory)
 {
        cli = do_connect(desthost, service);
-       
        if (!cli) {
                return(False);
        }
@@ -1788,7 +1787,7 @@ static void get_password_file(void)
                sscanf(p, "%d", &fd);
                close_it = False;
        } else if ((p = getenv("PASSWD_FILE")) != NULL) {
-               fd = open(p, O_RDONLY);
+               fd = sys_open(p, O_RDONLY, 0);
                pstrcpy(spec, p);
                if (fd < 0) {
                        fprintf(stderr, "Error opening PASSWD_FILE %s: %s\n",
@@ -1836,7 +1835,8 @@ handle a -L query
 static int do_host_query(char *query_host, int port)
 {
        cli = do_connect(query_host, "IPC$");
-       if (!cli) return 1;
+       if (!cli)
+               return 1;
 
        browse_host(True);
        list_servers(workgroup);
@@ -1854,6 +1854,8 @@ static int do_tar_op(int port, char *base_directory)
 {
        int ret;
        cli = do_connect(desthost, service);
+       if (!cli)
+               return 1;
 
        recurse=True;