faubackup2/src main.cpp,1.10,1.11
Erik Merkel <[email protected]> Thu, 09 Jun 2005 15:39:55 +0000
| Newsgroups | gmane.comp.sysutils.backup.faubackup.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/faubackup/faubackup2/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6636/src
Modified Files:
main.cpp
Log Message:
removed hardcoded protocol version on multiple positions
Index: main.cpp
===================================================================
RCS file: /cvsroot/faubackup/faubackup2/src/main.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** main.cpp 9 Jun 2005 12:04:01 -0000 1.10
--- main.cpp 9 Jun 2005 15:39:53 -0000 1.11
***************
*** 12,15 ****
--- 12,17 ----
#include "common/int_handler.hpp"
#include "common/registration.hpp"
+ #include "common/system_calls.hpp"
+
using std::string;
***************
*** 48,71 ****
struct poptOption options[] = {
! { "verbose", 'v', POPT_ARG_NONE, 0, 'v'},
! { "rsync", 'r', POPT_ARG_NONE, &rsync, 0,
! _("Use Rsync to transfer changed files")},
! { "one-file-system", 'x', POPT_ARG_NONE, &boundaries, 0,
! _("don't cross filesystem boundaries")},
! { "dry-run", 'n', POPT_ARG_NONE, &do_nothing, 0,
! _("don't create a new backup, test only")},
! { "server", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN,
! &server_destdir},
! { "client", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN,
! &client_sourcedir},
! { "version", 0, POPT_ARG_NONE, 0, 'V'},
! POPT_AUTOHELP
! POPT_TABLEEND
! };
/* argument parsing */
popt = poptGetContext("faubackup", argc, argv, options, 0);
poptSetOtherOptionHelp(popt,
! _("[OPTION...] [host:]source [host:]destination"));
while ((rc = poptGetNextOpt(popt)) != -1) {
switch (rc) {
--- 50,74 ----
struct poptOption options[] = {
! { "verbose", 'v', POPT_ARG_NONE, 0, 'v'
! },
! { "rsync", 'r', POPT_ARG_NONE, &rsync, 0,
! _("Use Rsync to transfer changed files")},
! { "one-file-system", 'x', POPT_ARG_NONE, &boundaries, 0,
! _("don't cross filesystem boundaries")},
! { "dry-run", 'n', POPT_ARG_NONE, &do_nothing, 0,
! _("don't create a new backup, test only")},
! { "server", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN,
! &server_destdir},
! { "client", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN,
! &client_sourcedir},
! { "version", 0, POPT_ARG_NONE, 0, 'V'},
! POPT_AUTOHELP
! POPT_TABLEEND
! };
/* argument parsing */
popt = poptGetContext("faubackup", argc, argv, options, 0);
poptSetOtherOptionHelp(popt,
! _("[OPTION...] [host:]source [host:]destination"));
while ((rc = poptGetNextOpt(popt)) != -1) {
switch (rc) {
***************
*** 88,104 ****
if (server_destdir) {
instance_name = "ssh-server";
! char bla = 42;
output.information("hidden server! " + string(server_destdir), DEBUG_OUTPUT);
! write(STDOUT_FILENO,&bla, 1);
server(server_destdir, STDIN_FILENO, STDOUT_FILENO);
exit(0);
- } else if (client_sourcedir) {
- instance_name = "ssh-client";
- char bla = 42;
- output.information("hidden client! " + string(client_sourcedir), DEBUG_OUTPUT);
- write(STDOUT_FILENO,&bla, 1);
- client(client_sourcedir, STDIN_FILENO, STDOUT_FILENO);
- exit(0);
}
const char* temp;
if ((temp = poptGetArg(popt)) == NULL) {
--- 91,110 ----
if (server_destdir) {
instance_name = "ssh-server";
! /* see piped_child() for details */
! char protocol_ver = PROTOCOL_VERSION;
output.information("hidden server! " + string(server_destdir), DEBUG_OUTPUT);
! write(STDOUT_FILENO,&protocol_ver, 1);
server(server_destdir, STDIN_FILENO, STDOUT_FILENO);
exit(0);
}
+ else
+ if (client_sourcedir) {
+ instance_name = "ssh-client";
+ char protocol_ver = PROTOCOL_VERSION;
+ output.information("hidden client! " + string(client_sourcedir), DEBUG_OUTPUT);
+ write(STDOUT_FILENO,&protocol_ver, 1);
+ client(client_sourcedir, STDIN_FILENO, STDOUT_FILENO);
+ exit(0);
+ }
const char* temp;
if ((temp = poptGetArg(popt)) == NULL) {
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20