Fix scandir() callback signatures

This commit is contained in:
2025-12-14 11:48:35 +01:00
parent f7567c5512
commit a67eeb9fd2
4 changed files with 34 additions and 26 deletions

View File

@@ -98,8 +98,8 @@ long mx_append (MAILSTREAM *stream,char *mailbox,append_t af,void *data);
long mx_append_msg (MAILSTREAM *stream,char *flags,MESSAGECACHE *elt,
STRING *st,SEARCHSET *set);
int mx_select (struct direct *name);
int mx_numsort (const void *d1,const void *d2);
int mx_select (const struct dirent *name);
int mx_numsort (const struct dirent **d1, const struct dirent **d2);
char *mx_file (char *dst,char *name);
long mx_lockindex (MAILSTREAM *stream);
void mx_unlockindex (MAILSTREAM *stream);
@@ -1110,7 +1110,7 @@ long mx_append_msg (MAILSTREAM *stream,char *flags,MESSAGECACHE *elt,
* Returns: T to use file name, NIL to skip it
*/
int mx_select (struct direct *name)
int mx_select (const struct dirent *name)
{
char c;
char *s = name->d_name;
@@ -1125,10 +1125,9 @@ int mx_select (struct direct *name)
* Returns: negative if d1 < d2, 0 if d1 == d2, postive if d1 > d2
*/
int mx_numsort (const void *d1,const void *d2)
int mx_numsort (const struct dirent **d1, const struct dirent **d2)
{
return atoi ((*(struct direct **) d1)->d_name) -
atoi ((*(struct direct **) d2)->d_name);
return atoi ((*d1)->d_name) - atoi ((*d2)->d_name);
}
@@ -1283,5 +1282,5 @@ void mx_setdate (char *file,MESSAGECACHE *elt)
time_t tp[2];
tp[0] = time (0); /* atime is now */
tp[1] = mail_longdate (elt); /* modification time */
utime (file,tp); /* set the times */
set_utime_from_tp(file,tp); /* set the times */
}