OS/2, eCS & ArcaOS - Technical > Applications

XTide

<< < (4/4)

Dave Yeo:
I seems to have messed up the branch.

--- Code: ---H:\tmp\LIB-TIME-tzdb>git branch
* main
  master

H:\tmp\LIB-TIME-tzdb>git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

H:\tmp\LIB-TIME-tzdb>git checkout main
Switched to branch 'main'
Your branch and 'origin/main' have diverged,
and have 5 and 1 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

H:\tmp\LIB-TIME-tzdb>git pull
fatal: refusing to merge unrelated histories

--- End code ---

Have to delete the branch and start over I guess.

Dave Yeo:
I've sorta fixed the repository. History is a bit broken with 3 initial commits, one mine and 2 yours but I doubt it matters.

Dave Yeo:

--- Quote from: Steven Levine on January 21, 2026, 06:39:51 am ---Without looking at the code, I have to guess that -DHAVE_ISSETUGID=0 is part of the problem.  This is going to trigger the compatibility code to build.  However, since we have a issetugid(), this is going to cause a problem.

--- End quote ---

The actual problem call to setugid() doesn't seem to be guarded. Further down there is another call to setugid() that is guarded by HAVE_ISSETUGID. As a single user system it seems we can define it to 0.

--- Code: ---/* Return 1 if the process is privileged, 0 otherwise.  */
/* static int */
int
issetugid(void)
{
# if HAVE_SYS_AUXV_H && defined AT_SECURE
  unsigned long val;
  errno = 0;
  val = getauxval(AT_SECURE);
  if (val || errno != ENOENT)
    return !!val;
# endif
# if HAVE_GETRESUID
  {
    uid_t ruid, euid, suid;
    gid_t rgid, egid, sgid;
    if (0 <= getresuid (&ruid, &euid, &suid)) {
      if ((ruid ^ euid) | (ruid ^ suid))
        return 1;
      if (0 <= getresgid (&rgid, &egid, &sgid))
        return !!((rgid ^ egid) | (rgid ^ sgid));
    }
  }
# endif

--- End code ---

The problem with the duplicate symbols comes from strftime.c, in the case of 32bit time_t, including localtime.c, which has already been compiled.
Seems to me the call to issetugid() could be simply replaced with return 0. Not sure the best way to do that for a void function. Perhaps this?

--- Code: ---#ifndef __OS2__
static int
issetugid(void)
#else
return 0;
#endif

--- End code ---

Edit: Note I had to remove the static due to conflicts with our headers where issetugid() is not static.
Edit2: Testing,

--- Code: ---localtime.c:391:1: error: expected identifier or '(' before 'return'
  391 | return 0;
      | ^~~~~~
localtime.c:393:1: error: expected identifier or '(' before '{' token
  393 | {
      | ^
make: *** [<builtin>: localtime.o] Error 1

--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version