diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-15 08:16:06 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-15 08:16:06 -0300 |
commit | b3d22cef93306849f7eaeba2907bcd1099f9e33f (patch) | |
tree | 5f9985f179d0e43f7caa8e99eaf627865f967ba0 /dbug | |
parent | f54a1182494db9bababccfa83692630bec51ca95 (diff) | |
download | mariadb-git-b3d22cef93306849f7eaeba2907bcd1099f9e33f.tar.gz |
WL#5486: Remove code for unsupported platforms
Remove MS-DOS specific code.
Diffstat (limited to 'dbug')
-rw-r--r-- | dbug/dbug.c | 87 | ||||
-rw-r--r-- | dbug/dbug_analyze.c | 118 |
2 files changed, 5 insertions, 200 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c index a4b381f2746..fd87669b8ca 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -95,7 +95,7 @@ #define fnmatch(A,B,C) strcmp(A,B) #endif -#if defined(MSDOS) || defined(__WIN__) +#if defined(__WIN__) #include <process.h> #endif @@ -302,7 +302,7 @@ static int DoTrace(CODE_STATE *cs); #define DISABLE_TRACE 4 /* Test to see if file is writable */ -#if defined(HAVE_ACCESS) && !defined(MSDOS) +#if defined(HAVE_ACCESS) static BOOLEAN Writable(const char *pathname); /* Change file owner and group */ static void ChangeOwner(CODE_STATE *cs, char *pathname); @@ -336,23 +336,19 @@ static unsigned long Clock(void); #define ERR_OPEN "%s: can't open debug output stream \"%s\": " #define ERR_CLOSE "%s: can't close debug file: " #define ERR_ABORT "%s: debugger aborting because %s\n" -#define ERR_CHOWN "%s: can't change owner/group of \"%s\": " /* * Macros and defines for testing file accessibility under UNIX and MSDOS. */ #undef EXISTS -#if !defined(HAVE_ACCESS) || defined(MSDOS) +#if !defined(HAVE_ACCESS) #define EXISTS(pathname) (FALSE) /* Assume no existance */ #define Writable(name) (TRUE) #else #define EXISTS(pathname) (access(pathname, F_OK) == 0) #define WRITABLE(pathname) (access(pathname, W_OK) == 0) #endif -#ifndef MSDOS -#define ChangeOwner(cs,name) -#endif /* @@ -2008,10 +2004,6 @@ static void DBUGOpenFile(CODE_STATE *cs, else { cs->stack->out_file= fp; - if (newfile) - { - ChangeOwner(cs, name); - } } } } @@ -2069,10 +2061,6 @@ static FILE *OpenProfile(CODE_STATE *cs, const char *name) else { cs->stack->prof_file= fp; - if (newfile) - { - ChangeOwner(cs, name); - } } } return fp; @@ -2266,42 +2254,6 @@ static BOOLEAN Writable(const char *pathname) /* * FUNCTION * - * ChangeOwner change owner to real user for suid programs - * - * SYNOPSIS - * - * static VOID ChangeOwner(pathname) - * - * DESCRIPTION - * - * For unix systems, change the owner of the newly created debug - * file to the real owner. This is strictly for the benefit of - * programs that are running with the set-user-id bit set. - * - * Note that at this point, the fact that pathname represents - * a newly created file has already been established. If the - * program that the debugger is linked to is not running with - * the suid bit set, then this operation is redundant (but - * harmless). - * - */ - -#ifndef ChangeOwner -static void ChangeOwner(CODE_STATE *cs, char *pathname) -{ - if (chown(pathname, getuid(), getgid()) == -1) - { - (void) fprintf(stderr, ERR_CHOWN, cs->process, pathname); - perror(""); - (void) fflush(stderr); - } -} -#endif - - -/* - * FUNCTION - * * _db_setjmp_ save debugger environment * * SYNOPSIS @@ -2470,7 +2422,7 @@ static unsigned long Clock() return ru.ru_utime.tv_sec*1000 + ru.ru_utime.tv_usec/1000; } -#elif defined(MSDOS) || defined(__WIN__) +#elif defined(__WIN__) static ulong Clock() { @@ -2519,37 +2471,6 @@ static unsigned long Clock() #endif /* RUSAGE */ #endif /* THREADS */ -#ifdef NO_VARARGS - -/* - * Fake vfprintf for systems that don't support it. If this - * doesn't work, you are probably SOL... - */ - -static int vfprintf(stream, format, ap) -FILE *stream; -char *format; -va_list ap; -{ - int rtnval; - ARGS_DCL; - - ARG0= va_arg(ap, ARGS_TYPE); - ARG1= va_arg(ap, ARGS_TYPE); - ARG2= va_arg(ap, ARGS_TYPE); - ARG3= va_arg(ap, ARGS_TYPE); - ARG4= va_arg(ap, ARGS_TYPE); - ARG5= va_arg(ap, ARGS_TYPE); - ARG6= va_arg(ap, ARGS_TYPE); - ARG7= va_arg(ap, ARGS_TYPE); - ARG8= va_arg(ap, ARGS_TYPE); - ARG9= va_arg(ap, ARGS_TYPE); - rtnval= fprintf(stream, format, ARGS_LIST); - return rtnval; -} - -#endif /* NO_VARARGS */ - #else /* diff --git a/dbug/dbug_analyze.c b/dbug/dbug_analyze.c index 3263b2ccc59..1ebe8bfd77e 100644 --- a/dbug/dbug_analyze.c +++ b/dbug/dbug_analyze.c @@ -561,9 +561,6 @@ FILE *outf; #define usage() fprintf (DBUG_FILE,"Usage: %s [-v] [prof-file]\n",my_name) -#ifdef MSDOS -extern int getopt(int argc, char **argv, char *opts); -#endif extern int optind; extern char *optarg; @@ -609,118 +606,5 @@ int main (int argc, char **argv) process (infile); output (outfile); DBUG_RETURN (EX_OK); + } } -} - -#ifdef MSDOS - -/* - * From std-unix@ut-sally.UUCP (Moderator, John Quarterman) Sun Nov 3 14:34:15 1985 - * Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site gatech.CSNET - * Posting-Version: version B 2.10.2 9/18/84; site ut-sally.UUCP - * Path: gatech!akgua!mhuxv!mhuxt!mhuxr!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!ut-sally!std-unix - * From: std-unix@ut-sally.UUCP (Moderator, John Quarterman) - * Newsgroups: mod.std.unix - * Subject: public domain AT&T getopt source - * Message-ID: <3352@ut-sally.UUCP> - * Date: 3 Nov 85 19:34:15 GMT - * Date-Received: 4 Nov 85 12:25:09 GMT - * Organization: IEEE/P1003 Portable Operating System Environment Committee - * Lines: 91 - * Approved: jsq@ut-sally.UUCP - * - * Here's something you've all been waiting for: the AT&T public domain - * source for getopt(3). It is the code which was given out at the 1985 - * UNIFORUM conference in Dallas. I obtained it by electronic mail - * directly from AT&T. The people there assure me that it is indeed - * in the public domain. - * - * There is no manual page. That is because the one they gave out at - * UNIFORUM was slightly different from the current System V Release 2 - * manual page. The difference apparently involved a note about the - * famous rules 5 and 6, recommending using white space between an option - * and its first argument, and not grouping options that have arguments. - * Getopt itself is currently lenient about both of these things White - * space is allowed, but not mandatory, and the last option in a group can - * have an argument. That particular version of the man page evidently - * has no official existence, and my source at AT&T did not send a copy. - * The current SVR2 man page reflects the actual behavor of this getopt. - * However, I am not about to post a copy of anything licensed by AT&T. - * - * I will submit this source to Berkeley as a bug fix. - * - * I, personally, make no claims or guarantees of any kind about the - * following source. I did compile it to get some confidence that - * it arrived whole, but beyond that you're on your own. - * - */ - -/*LINTLIBRARY*/ - -int opterr = 1; -int optind = 1; -int optopt; -char *optarg; - -static void _ERR(s,c,argv) -char *s; -int c; -char *argv[]; -{ - char errbuf[3]; - - if (opterr) { - errbuf[0] = c; - errbuf[1] = '\n'; - (void) fprintf(stderr, "%s", argv[0]); - (void) fprintf(stderr, "%s", s); - (void) fprintf(stderr, "%s", errbuf); - } -} - -int getopt(argc, argv, opts) -int argc; -char **argv, *opts; -{ - static int sp = 1; - register int c; - register char *cp; - - if(sp == 1) - if(optind >= argc || - argv[optind][0] != '-' || argv[optind][1] == '\0') - return(EOF); - else if(strcmp(argv[optind], "--") == 0) { - optind++; - return(EOF); - } - optopt = c = argv[optind][sp]; - if(c == ':' || (cp=strchr(opts, c)) == NULL) { - _ERR(": illegal option -- ", c, argv); - if(argv[optind][++sp] == '\0') { - optind++; - sp = 1; - } - return('?'); - } - if(*++cp == ':') { - if(argv[optind][sp+1] != '\0') - optarg = &argv[optind++][sp+1]; - else if(++optind >= argc) { - _ERR(": option requires an argument -- ", c, argv); - sp = 1; - return('?'); - } else - optarg = argv[optind++]; - sp = 1; - } else { - if(argv[optind][++sp] == '\0') { - sp = 1; - optind++; - } - optarg = NULL; - } - return(c); -} - -#endif /* !unix && !xenix */ |