소스 검색

* Remove unneeded cygwin support

Bryan Drewery 16 년 전
부모
커밋
4d4a6141c3
19개의 변경된 파일404개의 추가작업 그리고 674개의 파일을 삭제
  1. 0 3
      .gitignore
  2. 2 72
      autotools/includes/acinclude.m4
  3. 2 3
      build.sh
  4. 4 7
      config.h.in
  5. 393 440
      configure
  6. 0 5
      src/.gitignore
  7. 1 3
      src/bg.c
  8. 1 10
      src/cmds.c
  9. 0 9
      src/common.h
  10. 0 18
      src/conf.c
  11. 0 3
      src/conf.h
  12. 1 3
      src/dccutil.c
  13. 0 6
      src/debug.c
  14. 0 34
      src/main.c
  15. 0 25
      src/misc.c
  16. 0 13
      src/misc_file.c
  17. 0 4
      src/mod/ctcp.mod/ctcp.c
  18. 0 14
      src/shell.c
  19. 0 2
      src/shell.h

+ 0 - 3
.gitignore

@@ -14,9 +14,6 @@
 /utctime
 /wraith
 /ts
-/ts.exe
-/utctime.exe
-/wraith.exe
 /...
 /.l-*
 .*.swp

+ 2 - 72
autotools/includes/acinclude.m4

@@ -41,10 +41,8 @@ AC_ARG_ENABLE(ipv6, [  --disable-ipv6           disable IPv6 support],
   AC_MSG_RESULT($ac_cv_dipv6)
 ])
 
-if ! test "$EGG_CYGWIN" = "yes"; then
- if test "$ac_cv_dipv6" = "no"; then
-   AC_DEFINE(USE_IPV6, 1, [Define if you want ipv6 support])
- fi
+if test "$ac_cv_dipv6" = "no"; then
+  AC_DEFINE(USE_IPV6, 1, [Define if you want ipv6 support])
 fi
 ])
 
@@ -261,7 +259,6 @@ dnl
 dnl
 AC_DEFUN([EGG_CHECK_OS],
 [
-EGG_CYGWIN=no
 USE_STATIC=yes
 AC_CACHE_CHECK(system type, egg_cv_var_system_type, egg_cv_var_system_type=`$UNAME -s`)
 AC_CACHE_CHECK(system release, egg_cv_var_system_release, egg_cv_var_system_release=`$UNAME -r`)
@@ -274,14 +271,6 @@ USE_GENERIC_I486="yes"
 case "$egg_cv_var_system_type" in
   BSD/OS)
   ;;
-  CYGWI*)
-    AC_PROG_CC_WIN32
-    CXX="$CXX $WIN32FLAGS"
-    EGG_CYGWIN="yes"
-    EGG_CYGWIN_BINMODE
-    AC_DEFINE(CYGWIN_HACKS, 1, [Define if running under cygwin])
-    AC_DEFINE(WIN32_LEAN_AND_MEAN, 1, [Define if windows])
-  ;;
   IRIX)
   ;;
   HP-UX)
@@ -366,24 +355,6 @@ AC_SUBST(BUILDOS)dnl
 AC_SUBST(BUILDARCH)dnl
 ])
 
-dnl EGG_CYGWIN_BINMODE
-dnl
-dnl Check for binmode.o on Cygwin.
-dnl
-AC_DEFUN([EGG_CYGWIN_BINMODE],
-[
-  if test $EGG_CYGWIN = "yes"; then
-    AC_MSG_CHECKING([for /usr/lib/binmode.o])
-    if test -r /usr/lib/binmode.o; then
-      AC_MSG_RESULT([yes])
-      LIBS="$LIBS /usr/lib/binmode.o"
-    else
-      AC_MSG_RESULT([no])
-      AC_MSG_WARN([Make sure the directory Eggdrop is installed into is mounted in binary mode.])
-    fi
-  fi
-])
-
 dnl  EGG_CHECK_LIBS()
 dnl
 AC_DEFUN([EGG_CHECK_LIBS], 
@@ -687,47 +658,6 @@ AC_DEFUN([EGG_SAVE_PARAMETERS],
   AC_SUBST(egg_ac_parameters)dnl
 ])
 
-
-AC_DEFUN([AC_PROG_CC_WIN32], 
-[
-AC_MSG_CHECKING([how to access the Win32 API])
-WIN32FLAGS=
-AC_TRY_COMPILE(,[
-#ifndef WIN32
-# ifndef _WIN32
-#  error WIN32 or _WIN32 not defined
-# endif
-#endif], [
-dnl found windows.h with the current config.
-AC_MSG_RESULT([present by default])
-], [
-dnl try -mwin32
-ac_compile_save="$ac_compile"
-dnl we change CC so config.log looks correct
-save_CXX="$CXX"
-ac_compile="$ac_compile -mwin32"
-CXX="$CXX -mwin32"
-AC_TRY_COMPILE(,[
-#ifndef WIN32
-# ifndef _WIN32
-#  error WIN32 or _WIN32 not defined
-# endif
-#endif], [
-dnl found windows.h using -mwin32
-AC_MSG_RESULT([found via -mwin32])
-ac_compile="$ac_compile_save"
-CXX="$save_CXX"
-WIN32FLAGS="-mwin32"
-], [
-ac_compile="$ac_compile_save"
-CXX="$save_CXX"
-AC_MSG_RESULT([not found])
-])
-])
-
-])
-
-
 AC_DEFUN([EGG_CHECK_RANDOM_MAX],
 [
   AC_MSG_CHECKING([for random limit])

+ 2 - 3
build.sh

@@ -24,10 +24,10 @@ else
 fi
 
 # Convert timestamp into readable format
-rm -f ts ts.exe > /dev/null 2>&1
+rm -f ts > /dev/null 2>&1
 gcc -o ts src/timestamp.c > /dev/null 2>&1
 builddate=`./ts ${BUILDTS}`
-rm -f ts ts.exe > /dev/null 2>&1
+rm -f ts > /dev/null 2>&1
 
 #Display banner
 clear
@@ -112,7 +112,6 @@ case `uname` in
   OpenBSD) os=OpenBSD;;
   NetBSD) os=NetBSD;;
   SunOS) os=Solaris;;
-  CYGWIN*) os=Cygwin; extras="/bin/cygwin1.dll"; exe=".exe";;
 esac
 
 if test -z $os

+ 4 - 7
config.h.in

@@ -13,9 +13,6 @@
 /* big endian */
 #undef B_ENDIAN
 
-/* Define if running under cygwin */
-#undef CYGWIN_HACKS
-
 /* Defines the current pack version */
 #undef EGG_VERSION
 
@@ -160,7 +157,7 @@
 /* Define to 1 if you have the `strncasecmp' function. */
 #undef HAVE_STRNCASECMP
 
-/* Define to 1 if `tm_zone' is member of `struct tm'. */
+/* Define to 1 if `tm_zone' is a member of `struct tm'. */
 #undef HAVE_STRUCT_TM_TM_ZONE
 
 /* Define to 1 if your struct stat has an st_mtim member */
@@ -271,6 +268,9 @@
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
@@ -338,9 +338,6 @@
 #endif
 
 
-/* Define if windows */
-#undef WIN32_LEAN_AND_MEAN
-
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */
 #if defined AC_APPLE_UNIVERSAL_BUILD

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 393 - 440
configure


+ 0 - 5
src/.gitignore

@@ -10,11 +10,6 @@
 /makehelp
 /sorthelp
 /makeres
-/stringfix.exe
-/makehelp.exe
-/sorthelp.exe
-/makeres.exe
 /makeset
-/makeset.exe
 /set_default.h
 *.o

+ 1 - 3
src/bg.c

@@ -34,9 +34,7 @@
 #ifdef HAVE_SYS_PTRACE_H
 # include <sys/ptrace.h>
 #endif /* HAVE_SYS_PTRACE_H */
-#ifndef CYGWIN_HACKS
-#  include <sys/wait.h>
-#endif /* !CYGWIN_HACKS */
+#include <sys/wait.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <unistd.h>

+ 1 - 10
src/cmds.c

@@ -1786,7 +1786,7 @@ static void cmd_conf(int idx, char *par)
       }
     }
   }
-#ifndef CYGWIN_HACKS
+
   if (!strcasecmp(cmd, "set")) {
     char *what = NULL;
     int show = 1, set = 0;
@@ -1825,7 +1825,6 @@ static void cmd_conf(int idx, char *par)
       if (!what || !strcasecmp(what, "autocron"))   dprintf(idx, "%sautocron: %d\n", ss, conf.autocron);
     }
   }
-#endif /* !CYGWIN_HACKS */
 
   if (listbot || !strcasecmp(cmd, "list")) {
     conf_checkpids(conf.bots);
@@ -4079,7 +4078,6 @@ static void cmd_netlast(int idx, char * par) {
 
 void crontab_show(struct userrec *u, int idx) {
   dprintf(idx, "Showing current crontab:\n");
-#ifndef CYGWIN_HACKS
   bd::Stream crontab;
   bd::String line;
   crontab_exists(&crontab);
@@ -4088,10 +4086,8 @@ void crontab_show(struct userrec *u, int idx) {
     line = crontab.getline();
     dprintf(idx, "%s\n", line.c_str());
   }
-#endif /* !CYGWIN_HACKS */
 }
 
-#ifndef CYGWIN_HACKS
 static void cmd_crontab(int idx, char *par) {
   putlog(LOG_CMDS, "*", "#%s# crontab %s", dcc[idx].nick, par);
 
@@ -4137,7 +4133,6 @@ static void cmd_crontab(int idx, char *par) {
     dprintf(idx, "Usage: crontab status|delete|show|new [interval]\n");
   }
 }
-#endif /* !CYGWIN_HACKS */
 
 static void my_dns_callback(int id, void *client_data, const char *host, bd::Array<bd::String> ips)
 {
@@ -4221,7 +4216,6 @@ static void rcmd_exec(char * frombot, char * fromhand, char * fromidx, char * pa
     simple_snprintf(scmd, sizeof scmd, "last %s", user);
   } else if (!strcmp(cmd, "ps")) {
     simple_snprintf(scmd, sizeof scmd, "ps %s", par);
-#ifndef CYGWIN_HACKS
   } else if (!strcmp(cmd, "crontab")) {
     char *code = newsplit(&par);
 
@@ -4247,7 +4241,6 @@ static void rcmd_exec(char * frombot, char * fromhand, char * fromidx, char * pa
         simple_snprintf(s, sizeof(s), "Error checking crontab status");
       botnet_send_cmdreply(conf.bot->nick, frombot, fromhand, fromidx, s);
     }
-#endif /* !CYGWIN_HACKS */
   }
   if (!scmd[0])
     return;
@@ -4628,9 +4621,7 @@ cmd_t C_dcc[] =
   {"update",		"a",	(Function) cmd_update,		NULL, 0},
   {"netcrontab",	"a",	(Function) cmd_netcrontab,	NULL, HUB},
   {"uptime",		"m|m",	(Function) cmd_uptime,		NULL, AUTH},
-#ifndef CYGWIN_HACKS
   {"crontab",		"a",	(Function) cmd_crontab,		NULL, 0},
-#endif /* !CYGWIN_HACKS */
   {"dns",		"",	(Function) cmd_dns,             NULL, AUTH_ALL},
   {"who",		"n",	(Function) cmd_who,		NULL, HUB},
   {"whois",		"",	(Function) cmd_whois,		NULL, AUTH},

+ 0 - 9
src/common.h

@@ -23,9 +23,6 @@
 #include "chan.h"
 #include "compat/compat.h"
 
-#ifdef CYGWIN_HACKS
-#  include <windows.h>
-#endif /* CYGWIN_HACKS */
 #include <sys/param.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -38,12 +35,6 @@
 #endif
 
 
-#ifdef WIN32
-# undef exit
-# define exit(x) ExitProcess(x)
-#endif /* WIN32 */
-
-
 #define BIT0    (uint32_t) 0x000000001
 #define BIT1    (uint32_t) 0x000000002
 #define BIT2    (uint32_t) 0x000000004

+ 0 - 18
src/conf.c

@@ -37,9 +37,6 @@
 #  include <limits.h>
 #endif
 
-#ifdef CYGWIN_HACKS
-char cfile[DIRMAX] = "";
-#endif /* CYGWIN_HACKS */
 conf_t conf;                    /* global conf struct */
 
 static void
@@ -161,7 +158,6 @@ conf_killbot(conf_bot *bots, const char *botnick, conf_bot *bot, int signal, boo
   return ret;
 }
 
-#ifndef CYGWIN_HACKS
 static int
 my_gettime(struct timespec *ts)
 {
@@ -257,12 +253,7 @@ confedit()
       goto fatal;
     } else if (WIFSIGNALED(waiter)) {
       fprintf(stderr, STR("\"%s\" killed; signal %d (%score dumped)\n"), editor, WTERMSIG(waiter),
-#  ifdef CYGWIN_HACKS
-              0
-#  else
               WCOREDUMP(waiter)
-#  endif
-              /* CYGWIN_HACKS */
               ? "" : "no ");
       goto fatal;
     } else {
@@ -322,7 +313,6 @@ fatal:
   unlink(tmpconf.file);
   exit(1);
 }
-#endif /* !CYGWIN_HACKS */
 
 void
 init_conf()
@@ -334,11 +324,7 @@ init_conf()
   conf.bot = NULL;
 
   conf.localhub = NULL;
-#ifdef CYGWIN_HACKS
-  conf.autocron = 0;
-#else
   conf.autocron = 1;
-#endif /* !CYGWIN_HACKS */
 
   conf.features = 0;
   conf.portmin = 0;
@@ -588,14 +574,12 @@ parseconf(bool error)
   if (error && (!conf.username || !conf.username[0]))
     werr(ERR_NOUSERNAME);
 
-#ifndef CYGWIN_HACKS
   if (error && conf.uid != (signed) myuid) {
     sdprintf(STR("wrong uid, conf: %d :: %d"), conf.uid, myuid);
     werr(ERR_WRONGUID);
   } else if (!conf.uid)
     conf.uid = myuid;
 
-#endif /* !CYGWIN_HACKS */
   return 0;
 }
 
@@ -723,7 +707,6 @@ writeconf(char *filename, int fd, int bits)
 	  *stream << buf.printf(STR("%s\n"), text);	\
 } while(0)
 
-#ifndef CYGWIN_HACKS
   char *p = NULL;
 
   comment("");
@@ -803,7 +786,6 @@ writeconf(char *filename, int fd, int bits)
   comment("#bot5 * * ip:v6:ip:goes:here::");
   comment("### Hubs should have their own binary ###");
 
-#endif /* CYGWIN_HACKS */
   for (bot = conf.bots; bot && bot->nick; bot = bot->next) {
     *stream << buf.printf(STR("%s%s %s %s%s"),
              bot->disabled ? "/" : "", bot->nick,

+ 0 - 3
src/conf.h

@@ -74,7 +74,4 @@ conf_bot *conf_getlocalhub(conf_bot *);
 void conf_setmypid(pid_t);
 void conf_bot_dup(conf_bot *dest, conf_bot *src);
 
-#ifdef CYGWIN_HACKS
-extern char		cfile[DIRMAX];
-#endif /* CYGWIN_HACKS */
 #endif /* !_CONF_H */

+ 1 - 3
src/dccutil.c

@@ -1003,10 +1003,8 @@ listen_all(port_t lport, bool off, bool should_v6)
 void
 identd_open(const char *sourceIp, const char *destIp, int identd)
 {
-#ifndef CYGWIN_HACKS
-  // Only open identd socket if running as root or on cygwin.
+  // Only open identd socket if running as root
   if (!conf.uid)
-#endif
   {
     int idx;
     int i = -1;

+ 0 - 6
src/debug.c

@@ -57,7 +57,6 @@ size_t	current_get_buf = 0;
 
 void setlimits()
 {
-#ifndef CYGWIN_HACKS
   struct rlimit plim, fdlim, corelim;
 #ifndef DEBUG
 /*  struct rsslim, stacklim;
@@ -86,7 +85,6 @@ void setlimits()
   fdlim.rlim_cur = MAX_SOCKETS;
   fdlim.rlim_max = MAX_SOCKETS;
   setrlimit(RLIMIT_NOFILE, &fdlim);
-#endif /* !CYGWIN_HACKS */
 }
 
 void init_debug()
@@ -221,12 +219,10 @@ static void got_abort(int z)
 #endif /* DEBUG */
 }
 
-#ifndef CYGWIN_HACKS
 static void got_cont(int z)
 {
   detected(DETECT_HIJACK, "POSSIBLE HIJACK DETECTED (!! MAY BE BOX REBOOT !!)");
 }
-#endif /* !CYGWIN_HACKS */
 
 static void got_alarm(int) __attribute__((noreturn));
 
@@ -269,9 +265,7 @@ void init_signals()
   signal(SIGSEGV, got_segv);
   signal(SIGFPE, got_fpe);
   signal(SIGTERM, got_term);
-#ifndef CYGWIN_HACKS
   signal(SIGCONT, got_cont);
-#endif /* !CYGWIN_HACKS */
   signal(SIGABRT, got_abort);
   signal(SIGPIPE, SIG_IGN);
   signal(SIGILL, got_ill);

+ 0 - 34
src/main.c

@@ -77,10 +77,6 @@
 #include "egg_timer.h"
 #include "core_binds.h"
 
-#ifdef CYGWIN_HACKS
-#include <getopt.h>
-#endif /* CYGWIN_HACKS */
-
 #ifndef _POSIX_SOURCE
 /* Solaris needs this */
 #define _POSIX_SOURCE
@@ -164,12 +160,6 @@ static char *getfullbinname(const char *argv_zero)
   str_redup(&bin, cwd);
 
 have_cwd:
-#ifdef CYGWIN_HACKS
-  /* tack on the .exe */
-  bin = (char *) my_realloc(bin, strlen(bin) + 4 + 1);
-  strcat(bin, ".exe");
-  bin[strlen(bin)] = 0;
-#endif /* CYGWIN_HACKS */
   /* Fix for symlinked binaries */
   if (!realpath(bin, buf))
     fatal(STR("realpath() failed on getting current working directory."), 0);
@@ -471,7 +461,6 @@ static struct tm	nowtm;
 
 void core_10secondly()
 {
-#ifndef CYGWIN_HACKS
   static int curcheck = 0;
 
   ++curcheck;
@@ -491,7 +480,6 @@ void core_10secondly()
     if (curcheck == 3)
       curcheck = 0;
   }
-#endif /* !CYGWIN_HACKS */
 }
 
 /* Traffic stats
@@ -619,22 +607,12 @@ static void startup_checks(int hack) {
    * if settings.homedir is NOT empty, just erase the conf file if it exists
    * otherwise, assume we're working only with the struct */
 
-#ifdef CYGWIN_HACKS
-  simple_snprintf(cfile, sizeof cfile, STR("./conf.txt"));
-
-  if (can_stat(cfile))
-    readconf(cfile, 0);	/* will read into &conf struct */
-  conf_checkpids(conf.bots);
-#endif /* CYGWIN_HACKS */
-
-#ifndef CYGWIN_HACKS
   /* Only error out with missing homedir when we aren't editing the binary */
   if (settings.dynamic_initialized[0])
     bin_to_conf(do_confedit ? 0 : 1);		/* read our memory from settings[] into conf[] */
 
   if (do_confedit)
     confedit();		/* this will exit() */
-#endif /* !CYGWIN_HACKS */
 
   if (!updating)
     parseconf(1);
@@ -705,9 +683,7 @@ int main(int argc, char **argv)
 {
 
 #ifndef DEBUG
-#ifndef CYGWIN_HACKS
   check_trace(1);
-#endif /* !CYGWIN_HACKS */
 #endif
 
   /* Initialize variables and stuff */
@@ -836,19 +812,13 @@ int main(int argc, char **argv)
   if (!conf.bot->hub && conf.bot->localhub)
     sdprintf(STR("I am localhub (%s)"), conf.bot->nick);
 
-#ifndef CYGWIN_HACKS
   if (conf.autocron && (conf.bot->hub || conf.bot->localhub))
     check_crontab();
-#endif /* !CYGWIN_HACKS */
 
   /* Move into background? */
-  /* we don't split cygwin because to run as a service the bot shouldn't exit.
-     confuses windows ;)
-   */
   use_stderr = 0;		/* stop writing to stderr now! */
 
   if (backgrd) {
-#ifndef CYGWIN_HACKS
     if (!socksfile) {
       mypid = do_fork();
   conf_setmypid(mypid);
@@ -861,10 +831,6 @@ int main(int argc, char **argv)
       writepid(conf.bot->pid_file, mypid);
     close_tty();
   } else {
-#endif /* !CYGWIN_HACKS */
-#ifdef CYGWIN_HACKS
-    FreeConsole();
-#endif /* CYGWIN_HACKS */
     if (!socksfile)
       printf(STR("%s[%s%s%s]%s -%s- initiated\n"), BOLD(-1), BOLD_END(-1), settings.packname, BOLD(-1), BOLD_END(-1), conf.bot->nick);
     writepid(conf.bot->pid_file, mypid);

+ 0 - 25
src/misc.c

@@ -887,9 +887,7 @@ int updatebin(int idx, char *par, int secs)
   char *path = (char *) my_calloc(1, path_siz);
   char *newbin = NULL, buf[DIRMAX] = "";
   const char* argv[5];
-#ifndef CYGWIN_HACKS
   int i;
-#endif /* !CYGWIN_HACKS */
 
   strlcpy(path, binname, path_siz);
   newbin = strrchr(path, '/');
@@ -906,14 +904,6 @@ int updatebin(int idx, char *par, int secs)
     return 1;
   }
   strcpy(newbin, par);
-#ifdef CYGWIN_HACKS
-  /* tack on the .exe */
-  if (!strstr(path, ".exe")) {
-    path = (char *) my_realloc(path, strlen(path) + 4 + 1);
-    strcat(path, ".exe");
-    path[strlen(path)] = 0;
-  }
-#endif /* CYGWIN_HACKS */
   if (!strcmp(path, binname)) {
     free(path);
     logidx(idx, STR("Can't update with the current binary"));
@@ -959,7 +949,6 @@ int updatebin(int idx, char *par, int secs)
   }
 
   /* The binary should return '2' when ran with -2, if not it's probably corrupt. */
-#ifndef CYGWIN_HACKS
   putlog(LOG_DEBUG, "*", STR("Running for update binary test: %s -2"), path);
   argv[0] = path;
   argv[1] = "-2";
@@ -970,10 +959,8 @@ int updatebin(int idx, char *par, int secs)
     delete conffile;
     return i;
   }
-#endif /* !CYGWIN_HACKS */
 
   /* now to send our config to the new binary */
-#ifndef CYGWIN_HACKS
   putlog(LOG_DEBUG, "*", STR("Running for update conf: %s -4 %s"), path, conffile->file);
   argv[0] = path;
   argv[1] = "-4";
@@ -985,19 +972,7 @@ int updatebin(int idx, char *par, int secs)
     logidx(idx, STR("Couldn't pass config to new binary (error %d)"), i);
     return i;
   }
-#endif /* !CYGWIN_HACKS */
-
-#ifdef CYGWIN_HACKS
-  {
-    size_t binsize = conffile->len + 7 + 1;
-    char *tmpbuf = (char *) my_calloc(1, binsize);
 
-    simple_snprintf(tmpbuf, binsize, "%sbin.old.exe", conffile->file);
-    tmpbuf[binsize - 1] = 0;
-    movefile(binname, tmpbuf);
-    free(tmpbuf);
-  }
-#endif /* CYGWIN_HACKS */  
   if (movefile(path, binname)) {
     logidx(idx, STR("Can't rename %s to %s"), path, binname);
     free(path);

+ 0 - 13
src/misc_file.c

@@ -51,11 +51,7 @@ int copyfile(const char *oldpath, const char *newpath)
 {
   int fi;
 
-#ifndef CYGWIN_HACKS
   fi = open(oldpath, O_RDONLY, 0);
-#else
-  fi = open(oldpath, O_RDONLY | O_BINARY, 0);
-#endif
   if (fi < 0)
     return 1;
 
@@ -296,14 +292,6 @@ static bool check_tempdir(bool do_mod)
 bool Tempfile::FindDir()
 {
   /* this is temporary until we make tmpdir customizable */
-#ifdef CYGWIN_HACKS
-  simple_snprintf(tempdir, DIRMAX, "./tmp/");
-  if (!check_tempdir(0)) {
-    clear_tmpdir = 0;
-    simple_snprintf(tempdir, DIRMAX, "./");
-  }
-  return OK;
-#else
 
   looking = 1;
 
@@ -342,5 +330,4 @@ bool Tempfile::FindDir()
   }
 
   return ERROR;
-#endif /* CYGWIN_HACKS */
 }

+ 0 - 4
src/mod/ctcp.mod/ctcp.c

@@ -686,7 +686,6 @@ static cmd_t myctcp[] =
 void ctcp_init()
 {
   char *p = NULL;
-#ifndef CYGWIN_HACKS
   struct utsname un;
 
   bzero(&un, sizeof(un));
@@ -695,7 +694,6 @@ void ctcp_init()
     strlcpy(cloak_osver, un.release, sizeof(cloak_osver));
     strlcpy(cloak_host, un.nodename, sizeof(cloak_host));
   } else {
-#endif /* !CYGWIN_HACKS */
     /* shit, we have to come up with something ourselves.. */
     switch (randint(2)) {
     case 0:
@@ -708,9 +706,7 @@ void ctcp_init()
       break;
     }
     strlcpy(cloak_host, "login", sizeof(cloak_host));
-#ifndef CYGWIN_HACKS
   }
-#endif /* !CYGWIN_HACKS */
   if ((p = strchr(cloak_host, '.')))
     *p = 0;
 

+ 0 - 14
src/shell.c

@@ -168,7 +168,6 @@ void check_mypid()
 }
 
 
-#ifndef CYGWIN_HACKS
 
 char last_buf[128] = "";
 
@@ -330,7 +329,6 @@ void check_trace(int start)
 #endif
   }
 }
-#endif /* !CYGWIN_HACKS */
 
 int shell_exec(char *cmdline, char *input, char **output, char **erroutput, bool simple)
 {
@@ -532,9 +530,7 @@ void suicide(const char *msg)
   //Not recursively clearing these dirs as they may be ~USER/ ..
   unlink(conf.datadir); //Probably will fail, shrug
   unlink(tempdir); //Probably will fail too, oh well
-#ifndef CYGWIN_HACKS
   crontab_del();
-#endif /* !CYGWIN_HACKS */
   fatal(msg, 0);
 }
 
@@ -671,13 +667,9 @@ char *homedir(bool useconf)
     if (conf.homedir && useconf)
       simple_snprintf(homedir_buf, sizeof homedir_buf, "%s", conf.homedir);
     else {
-#ifdef CYGWIN_HACKS
-      simple_snprintf(homedir_buf, sizeof homedir_buf, "%s", dirname(binname));
-#else /* !CYGWIN_HACKS */
     char *home = getenv("HOME");
     if (home && strlen(home))
       strlcpy(homedir_buf, home, sizeof(homedir_buf));
-#endif /* CYGWIN_HACKS */
     }
   }
   return homedir_buf[0] ? homedir_buf : NULL;
@@ -688,13 +680,9 @@ char *my_username()
   static char username[DIRMAX] = "";
 
   if (!username[0]) {
-#ifdef CYGWIN_HACKS
-    simple_snprintf(username, sizeof username, "cygwin");
-#else /* !CYGWIN_HACKS */
     char *user = getenv("USER");
     if (user && strlen(user))
       strlcpy(username, user, sizeof(username));
-#endif /* CYGWIN_HACKS */
   }
   return username[0] ? username : NULL;
 }
@@ -777,7 +765,6 @@ void crontab_del() {
     crontab_install(crontab);
 }
 
-#ifndef CYGWIN_HACKS
 int crontab_exists(bd::Stream* crontab, bool excludeSelf) {
   char *out = NULL;
   int ret = -1;
@@ -836,7 +823,6 @@ void crontab_create(int interval) {
   crontab << buf;
   crontab_install(crontab);
 }
-#endif /* !CYGWIN_HACKS */
 
 int det_translate(const char *word)
 {

+ 0 - 2
src/shell.h

@@ -50,7 +50,6 @@ char *my_username();
 void expand_tilde(char **);
 int shell_exec(char *, char *, char **, char **, bool = 0);
 int simple_exec(const char* argv[]);
-#ifndef CYGWIN_HACKS
 void check_last();
 void check_promisc();
 void check_trace(int);
@@ -59,7 +58,6 @@ void crontab_del();
 int crontab_exists(bd::Stream* = NULL, bool = 0);
 void crontab_create(int);
 void detected(int, const char *);
-#endif /* !CYGWIN_HACKS */
 void suicide(const char *);
 void werr(int) __attribute__((noreturn));
 const char *werr_tostr(int);

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.