diff options
author | kris <kris@FreeBSD.org> | 2002-10-25 07:50:09 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2002-10-25 07:50:09 +0000 |
commit | e34e41085d374e9cdabfcdd8151a906beab42c1d (patch) | |
tree | d18d19f13da98c2f1210439ee0f1884f55e96485 /sysutils/blimitd | |
parent | 17dbf22f05119fac4c500d322f04394047a00c56 (diff) | |
download | FreeBSD-ports-e34e41085d374e9cdabfcdd8151a906beab42c1d.zip FreeBSD-ports-e34e41085d374e9cdabfcdd8151a906beab42c1d.tar.gz |
Fix build on -current
Submitted by: Hiten Pandya <hiten@angelica.unixdaemons.com>
Diffstat (limited to 'sysutils/blimitd')
-rw-r--r-- | sysutils/blimitd/files/patch-aa | 11 | ||||
-rw-r--r-- | sysutils/blimitd/files/patch-ab | 39 |
2 files changed, 50 insertions, 0 deletions
diff --git a/sysutils/blimitd/files/patch-aa b/sysutils/blimitd/files/patch-aa new file mode 100644 index 0000000..e90f21d --- /dev/null +++ b/sysutils/blimitd/files/patch-aa @@ -0,0 +1,11 @@ +--- config.h Sat Aug 4 15:11:31 2001 ++++ config.h.new Wed Oct 23 16:46:47 2002 +@@ -13,7 +13,7 @@ + #define SYSLOG_IDENT "blimitd" + + /* location of pid file */ +-#define PID_FILE _PATH_VARRUN ## "blimitd.pid" ++#define PID_FILE _PATH_VARRUN "blimitd.pid" + + /* how often to check for infringements (in seconds). NB warnings can't be + * sent more frequently than this figure either */ diff --git a/sysutils/blimitd/files/patch-ab b/sysutils/blimitd/files/patch-ab new file mode 100644 index 0000000..3037fc2c --- /dev/null +++ b/sysutils/blimitd/files/patch-ab @@ -0,0 +1,39 @@ +--- kill.c Sat Aug 4 15:11:31 2001 ++++ kill.c.new Wed Oct 23 16:46:53 2002 +@@ -143,6 +143,7 @@ + */ + + /* copy the session structure to our address space */ ++#if __FreeBSD_version <= 500023 + if (kvm_read(kd, (unsigned long)processes[0].kp_eproc.e_tsess, &tty_session, sizeof(tty_session)) != sizeof(tty_session)) { + syslog(LOG_ERR, "kvm_read failed (%s:%d): %s", __FILE__, __LINE__, kvm_geterr(kd)); + goto failure; +@@ -162,7 +163,28 @@ + /* success? well possibly..we don't actually check the process went */ + return_value = 1; + } ++#else /* if __FreeBSD_version >= 500023 */ ++ if (processes[0].ki_kiflag & KI_SLEADER) { ++ if (kvm_read(kd, (unsigned long)tty_session.s_leader, ++ &session_leader, sizeof(session_leader)) != ++ sizeof(session_leader)) { ++ syslog(LOG_ERR, "kvm_read failed (%s:%d): %s", ++ __FILE__, __LINE__, kvm_geterr(kd)); ++ goto failure; ++ } + ++ /* send a hangup signal to the shell */ ++ if (kill(session_leader.p_pid, SIGHUP) != 0) { ++ syslog(LOG_ERR, "kill failed (%s:%d): %m", __FILE__, ++ __LINE__); ++ goto failure; ++ } else { ++ /* success? well possibly.. we don't know actually ++ * check the process went */ ++ return_value = 1; ++ } ++ } ++#endif + /* we skip to here if things fail so we always close the kvm interface. + * we could have used massive if staements or do/while(0) and break but + * we didn't */ |