mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-01 06:16:38 +02:00
New module rehash system fixes
This commit is contained in:
@@ -2615,3 +2615,5 @@ seen. gmtime warning still there
|
||||
after a newer version has been compiled. This also fixes the problem with hooks disappearing
|
||||
during a rehash (#0001332) reported by AngryWolf and (#0001325) reported by Cnils. This
|
||||
might need some testing.
|
||||
- Fixed some problems with the copyfile routine for the new module rehash system and also fixed
|
||||
an issue with rehashing when permanent modules are loaded
|
||||
|
||||
@@ -162,11 +162,13 @@ char *Module_Create(char *path_)
|
||||
if (!mod_header)
|
||||
{
|
||||
irc_dlclose(Mod);
|
||||
remove(tmppath);
|
||||
return ("Unable to locate Mod_Header");
|
||||
}
|
||||
if (!mod_header->modversion)
|
||||
{
|
||||
irc_dlclose(Mod);
|
||||
remove(tmppath);
|
||||
return ("Lacking mod_header->modversion");
|
||||
}
|
||||
if (sscanf(mod_header->modversion, "3.2-b%d-%d", &betaversion, &tag)) {
|
||||
@@ -174,6 +176,7 @@ char *Module_Create(char *path_)
|
||||
snprintf(errorbuf, 1023, "Unsupported version, we support %s, %s is %s",
|
||||
MOD_WE_SUPPORT, path, mod_header->modversion);
|
||||
irc_dlclose(Mod);
|
||||
remove(tmppath);
|
||||
return(errorbuf);
|
||||
}
|
||||
}
|
||||
@@ -181,11 +184,13 @@ char *Module_Create(char *path_)
|
||||
!mod_header->description)
|
||||
{
|
||||
irc_dlclose(Mod);
|
||||
remove(tmppath);
|
||||
return("Lacking sane header pointer");
|
||||
}
|
||||
if (Module_Find(mod_header->name))
|
||||
{
|
||||
irc_dlclose(Mod);
|
||||
remove(tmppath);
|
||||
return (NULL);
|
||||
}
|
||||
mod = (Module *)Module_make(mod_header, Mod);
|
||||
|
||||
+11
-3
@@ -1733,12 +1733,20 @@ void unreal_copyfile(char *src, char *dest)
|
||||
{
|
||||
char buf[2048];
|
||||
int srcfd = open(src, O_RDONLY);
|
||||
int destfd = open(dest, O_WRONLY|O_CREAT, S_IRUSR|S_IXUSR);
|
||||
int destfd;
|
||||
int len;
|
||||
|
||||
if (srcfd < 1)
|
||||
return;
|
||||
|
||||
destfd = open(dest, O_WRONLY|O_CREAT, S_IRUSR|S_IXUSR);
|
||||
|
||||
if (destfd < 1)
|
||||
return;
|
||||
|
||||
while ((len = read(srcfd, buf, 1023)) > 0)
|
||||
write(destfd, buf, len);
|
||||
|
||||
close(src);
|
||||
close(dest);
|
||||
close(srcfd);
|
||||
close(destfd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user