|
System | : | Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686 |
Software | : | Apache. PHP/5.3.6-13ubuntu3.10 |
ID | : | uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
|
|
Safe Mode | : | OFF |
Open_Basedir | : | OFF |
Freespace | : | 25.68 GB of 70.42 GB (36.47%) |
|
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON |
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
|
[ System Info ]
[ Processes ]
[ SQL Manager ]
[ Eval ]
[ Encoder ]
[ Mailer ]
[ Back Connection ]
[ Backdoor Server ]
[ Kernel Exploit Search ]
[ MD5 Decrypter ]
[ Reverse IP ]
[ Kill Shell ]
[ FTP Brute-Force ]
|
|
/
usr/
src/
courier-0.66.1/
maildrop/
- drwxrwxrwx
|
Viewing file: alarm.C (1.68 KB) -rw-rw-rw-Select action/file-type:  ( +) |  ( +) |  ( +) | Code ( +) | Session ( +) |  ( +) | SDB ( +) |  ( +) |  ( +) |  ( +) |  ( +) |  ( +) |
#include "config.h" #include <iostream>
#if HAVE_UNISTD_H #include <unistd.h> #else extern "C" long alarm(long); #endif
#include <signal.h> #include "alarm.h"
Alarm *Alarm::first=0; Alarm *Alarm::last=0;
Alarm::~Alarm() { Cancel(); }
void Alarm::Unlink() { set_interval=0; if (prev) prev->next=next; else first=next; if (next) next->prev=prev; else last=prev; }
void Alarm::cancel_sig(unsigned seconds_left) { Alarm *p; Alarm *alarm_chain=0;
while ((p=first) != 0 && p->set_interval <= seconds_left) // Marginal case { p->Unlink(); p->next=alarm_chain; alarm_chain=p; }
for (p=first; p; p=p->next) p->set_interval -= seconds_left;
while ((p=alarm_chain) != 0) { alarm_chain=p->next; p->handler(); } }
void Alarm::set_sig() { if (!first) return; signal(SIGALRM, &Alarm::alarm_func); alarm(first->set_interval); }
RETSIGTYPE Alarm::alarm_func(int) { if (first) cancel_sig(first->set_interval); set_sig();
#if RETSIGTYPE != void return (0); #endif }
unsigned Alarm::sig_left() { if (!first) return (0);
unsigned n=alarm(0);
return (n ? n <= first->set_interval ? first->set_interval - n:0:0); }
void Alarm::Set(unsigned nseconds) { Cancel(); // Just in case if (nseconds == 0) { handler(); // Fooey. return; }
cancel_sig(sig_left());
Alarm *p;
for (p=first; p; p=p->next) if (p->set_interval > nseconds) break;
if (!p) { next=0; if ((prev=last) != 0) prev->next=this; else first=this; last=this; } else { if ((prev=p->prev) != 0) prev->next=this; else first=this; next=p; p->prev=this; } set_interval=nseconds; set_sig(); }
void Alarm::Cancel() { cancel_sig(sig_left()); if (set_interval) Unlink(); set_sig(); }
|