Skip to Content.
Sympa Menu

freetds - [freetds] [PATCH] to remove exit statements from libct

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: David Dick <ddick AT cpan.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] [PATCH] to remove exit statements from libct
  • Date: Sun, 28 Feb 2010 14:34:22 +1100

can we remove the exit statements from inside shared libraries? The attached patch removes the exit statements for the libct library in a hopefully acceptable fashion.
diff -Naur old/src/tds/login.c new/src/tds/login.c
--- old/src/tds/login.c 2007-12-31 21:06:50.000000000 +1100
+++ new/src/tds/login.c 2010-02-27 15:48:38.000000000 +1100
@@ -549,7 +549,7 @@
memcpy(program_version, "\005\000\000\000", 4);
} else {
tdsdump_log(TDS_DBG_SEVERE, "Unknown protocol version!\n");
- exit(1);
+ return TDS_FAIL;
}
/*
* the following code is adapted from Arno Pedusaar's
diff -Naur old/src/tds/net.c new/src/tds/net.c
--- old/src/tds/net.c 2008-01-12 11:21:39.000000000 +1100
+++ new/src/tds/net.c 2010-02-27 15:48:38.000000000 +1100
@@ -444,12 +444,11 @@
continue;
case TDS_INT_CANCEL: /* abort the current
command batch */
/* FIXME tell
tds_goodread() not to call tdserror() */
- return 0;
+ return TDS_FAIL;
default:
tdsdump_log(TDS_DBG_NETWORK,
"tds_select: invalid interupt handler
return code: %d\n", timeout_action);
- exit(EXIT_FAILURE);
- break;
+ return TDS_FAIL;
}
}
/*
diff -Naur old/src/tds/token.c new/src/tds/token.c
--- old/src/tds/token.c 2008-01-27 21:41:23.000000000 +1100
+++ new/src/tds/token.c 2010-02-27 15:48:38.000000000 +1100
@@ -3080,8 +3080,7 @@
default:
tdsdump_log(TDS_DBG_INFO1, "oops: cannot process option of
size %d\n", argsize);
assert(argsize <= 4);
- exit(1); /* FIXME: stream would become desynchronized
*/
- break;
+ return TDS_FAIL;
}
tdsdump_log(TDS_DBG_INFO1, "received option %d value %d\n", option,
arg);

diff -Naur old/src/tds/util.c new/src/tds/util.c
--- old/src/tds/util.c 2007-12-07 16:27:55.000000000 +1100
+++ new/src/tds/util.c 2010-02-27 15:48:38.000000000 +1100
@@ -375,7 +375,7 @@
case TDS_INT_TIMEOUT:
case TDS_INT_CONTINUE:
tdsdump_log(TDS_DBG_FUNC, "exit: %s(%d) valid only
for TDSETIME\n", retname(rc), rc);
- exit(1);
+ return TDS_FAIL;
default:
break;
}



Archive powered by MHonArc 2.6.24.

Top of Page