...
 
Commits (7)
......@@ -4,6 +4,8 @@
inherit Thread : pre;
#if constant(thread_create)
//! Create a new thread.
//!
//! @deprecated predef::Thread.Thread
......@@ -11,3 +13,5 @@ optional Thread `()( mixed f, mixed ... args )
{
return thread_create( f, @args );
}
#endif
......@@ -14,7 +14,7 @@
#if constant(thread_create)
#define do_possibly_threaded_call thread_create
#else
#define do_possibly_threaded_call call_function
#define do_possibly_threaded_call predef::`()
#endif
#define DEFAULT_CLEANUP_CYCLE 300
......
......@@ -197,7 +197,9 @@ int verify(string(8bit) password, string(7bit) hash)
return 0;
}
#if constant(Nettle.bcrypt_hash)
string(7bit) fullhash = hash;
#endif
// Then try our implementations.
if (!sscanf(hash, "$%s$%s", scheme, hash)) return 0;
sscanf(hash, "%s$%s", string(7bit) salt, hash);
......
......@@ -3,6 +3,7 @@
//! This allows for logging to occur with minimal timing interference.
#pike __REAL_VERSION__
#require constant(Thread.Thread)
#pragma dynamic_dot
......
......@@ -932,7 +932,7 @@ int valid_seq_nump(int num)
if (num < next_seq_num-(window_size)) return 0;
if (num >= next_seq_num) return 1;
if (num == next_seq_num-1) return 0;
return !(sequence_mask & (1<<(num + window_size - next_seq_num)));
return !(sequence_mask & (1<<[int(0..)](num + window_size - next_seq_num)));
}
//! Mark seqence number @[num] as seen and accepted.
......@@ -944,12 +944,12 @@ void mark_seq_num(int num)
if (num < next_seq_num-(window_size)) return;
if (num == next_seq_num-1) return;
if (num < next_seq_num) {
sequence_mask |= (1<<(num + window_size - next_seq_num));
sequence_mask |= (1<<[int(0..)](num + window_size - next_seq_num));
} else {
int delta = 1 + num - next_seq_num;
if (delta < window_size) {
sequence_mask >>= delta;
sequence_mask |= 1 << (window_size-(delta + 1));
sequence_mask >>= [int(1..)]delta;
sequence_mask |= 1 << [int(0..)](window_size-(delta + 1));
} else {
sequence_mask = 0;
}
......
......@@ -641,7 +641,7 @@ void do_install(string name, string|void version)
if(!Process.search_path("gzip"))
exit(1, "install error: no gzip found in PATH.\n");
else
res = Process.system("gzip -f -d " + fn);
res = Process.Process(({"gzip", "-f", "-d", fn}))->wait();
if(res)
exit(1, "install error: uncompress failed.\n");
......@@ -672,7 +672,7 @@ void do_install(string name, string|void version)
if(!Process.search_path("tar"))
exit(1, "install error: no tar found in PATH.\n");
else
res = Process.system("tar xvf " + fn);
res = Process.Process(({"tar", "xvf", fn}))->wait();
if(res)
exit(1, "install error: untar failed.\n");
......
......@@ -114,7 +114,11 @@ int main(int num, array(string) args)
write("-"*65+"\n%-40s%18s%7s\n"+"-"*65+"\n",
"Test","Result","Change");
#if constant(Thread.Thread)
call_out(Thread.Thread, 0, run_tests);
#else
call_out(run_tests, 0);
#endif
return -1;
}
......