/[rdesktop]/sourceforge.net/trunk/rdesktop/rdesktop.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/rdesktop.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 376 by jsorg71, Mon May 19 21:36:33 2003 UTC revision 424 by forsberg, Thu Jun 19 07:29:53 2003 UTC
# Line 149  main(int argc, char *argv[]) Line 149  main(int argc, char *argv[])
149          char password[16];          char password[16];
150          char shell[128];          char shell[128];
151          char directory[32];          char directory[32];
152          BOOL prompt_password;          BOOL prompt_password, rdp_retval = False;
153          struct passwd *pw;          struct passwd *pw;
154          uint32 flags;          uint32 flags;
155          char *p;          char *p;
# Line 366  main(int argc, char *argv[]) Line 366  main(int argc, char *argv[])
366    
367  #ifdef RDP2VNC  #ifdef RDP2VNC
368          rdp2vnc_connect(server, flags, domain, password, shell, directory);          rdp2vnc_connect(server, flags, domain, password, shell, directory);
369            return 0;
370  #else  #else
371    
372          if (!ui_init())          if (!ui_init())
373                  return 1;                  return 1;
374    
375            ipc_init();             // Must be run after ui_init, we need X to be setup.
376    
377            if (use_rdp5)
378                    cliprdr_init(); // FIXME: Should perhaps be integrated into the channel management code?
379    
380          if (!rdp_connect(server, flags, domain, password, shell, directory))          if (!rdp_connect(server, flags, domain, password, shell, directory))
381                  return 1;                  return 1;
382    
# Line 379  main(int argc, char *argv[]) Line 385  main(int argc, char *argv[])
385    
386          if (ui_create_window())          if (ui_create_window())
387          {          {
388                  rdp_main_loop();                  rdp_retval = rdp_main_loop();
389                  ui_destroy_window();                  ui_destroy_window();
390          }          }
391    
# Line 387  main(int argc, char *argv[]) Line 393  main(int argc, char *argv[])
393          rdp_disconnect();          rdp_disconnect();
394          ui_deinit();          ui_deinit();
395    
396            if (True == rdp_retval)
397                    return 0;
398            else
399                    return 2;
400    
401  #endif  #endif
402    
         return 0;  
403  }  }
404    
405  #ifdef EGD_SOCKET  #ifdef EGD_SOCKET
# Line 588  load_licence(unsigned char **data) Line 598  load_licence(unsigned char **data)
598          if (home == NULL)          if (home == NULL)
599                  return -1;                  return -1;
600    
601          path = (char*)xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));          path = (char *) xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));
602          sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);          sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);
603    
604          fd = open(path, O_RDONLY);          fd = open(path, O_RDONLY);
# Line 598  load_licence(unsigned char **data) Line 608  load_licence(unsigned char **data)
608          if (fstat(fd, &st))          if (fstat(fd, &st))
609                  return -1;                  return -1;
610    
611          *data = (uint8*)xmalloc(st.st_size);          *data = (uint8 *) xmalloc(st.st_size);
612          length = read(fd, *data, st.st_size);          length = read(fd, *data, st.st_size);
613          close(fd);          close(fd);
614          xfree(path);          xfree(path);
# Line 615  save_licence(unsigned char *data, int le Line 625  save_licence(unsigned char *data, int le
625          if (home == NULL)          if (home == NULL)
626                  return;                  return;
627    
628          path = (char*)xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));          path = (char *) xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));
629    
630          sprintf(path, "%s/.rdesktop", home);          sprintf(path, "%s/.rdesktop", home);
631          if ((mkdir(path, 0700) == -1) && errno != EEXIST)          if ((mkdir(path, 0700) == -1) && errno != EEXIST)
# Line 627  save_licence(unsigned char *data, int le Line 637  save_licence(unsigned char *data, int le
637          /* write licence to licence.hostname.new, then atomically rename to licence.hostname */          /* write licence to licence.hostname.new, then atomically rename to licence.hostname */
638    
639          sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);          sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);
640          tmppath = (char*)xmalloc(strlen(path) + sizeof(".new"));          tmppath = (char *) xmalloc(strlen(path) + sizeof(".new"));
641          strcpy(tmppath, path);          strcpy(tmppath, path);
642          strcat(tmppath, ".new");          strcat(tmppath, ".new");
643    
644          fd = open(tmppath, O_WRONLY|O_CREAT|O_TRUNC, 0600);          fd = open(tmppath, O_WRONLY | O_CREAT | O_TRUNC, 0600);
645          if (fd == -1)          if (fd == -1)
646          {          {
647                  perror(tmppath);                  perror(tmppath);

Legend:
Removed from v.376  
changed lines
  Added in v.424

  ViewVC Help
Powered by ViewVC 1.1.26