Tk Source Code

View Ticket
Login
Ticket UUID: 219966
Title: OS/390 has no passwd.pw_gecos field
Type: Bug Version: obsolete: 8.1b2
Submitter: welch Created on: 2000-10-31 21:57:29
Subsystem: 06. Canvas Postscript Assigned To: nobody
Priority: 1 Zero Severity:
Status: Closed Last Modified: 2001-04-25 06:24:41
Resolution: Duplicate Closed By: dgp
    Closed on: 2001-04-24 23:24:41
Description:
OriginalBugID: 1724 Bug
Version: 8.1b2
SubmitDate: '1999-04-05'
LastModified: '1999-04-05'
Severity: MED
Status: Closed
Submitter: pat
ChangedBy: pat
OS: Other
OSVersion: OS/390 4.0
Machine: NA
ClosedDate: '1999-04-05'


Name:
Christian Krone

Extensions:
Expect 5.28

ReproducibleScript:
Compilation error on OS/390 for tkCanvPs.c,
    since the passwd struct has no pw_gecos field.

Patch:
*** unix/configure.in.orgWed Mar 17 04:29:03 1999
--- unix/configure.inTue Mar 23 13:10:54 1999
***************
*** 199,204 ****
--- 199,216 ----
  AC_CHECK_HEADERS(sys/time.h)
  AC_HEADER_TIME

+ #-------------------------------------------
+ #In OS/390 struct pwd has no pw_gecos field
+ #-------------------------------------------
+ 
+ AC_MSG_CHECKING([pw_gecos in struct pwd])
+ AC_TRY_COMPILE([#include <pwd.h>],
+ [struct passwd pwd; pwd.pw_gecos;], tk_ok=yes, tk_ok=no)
+ AC_MSG_RESULT($tk_ok)
+ if test $tk_ok = yes; then
+     AC_DEFINE(HAVE_PW_GECOS)
+ fi
+ 
  #--------------------------------------------------------------------
  #Locate the X11 header files and the X11 library archive.  Try
  #the ac_path_x macro first, but if it doesn't find the X stuff
*** unix/configure.orgWed Mar 17 04:29:03 1999
--- unix/configureTue Mar 23 13:12:11 1999
***************
*** 1434,1439 ****
--- 1434,1471 ----
  fi

+ #-------------------------------------------
+ #In OS/390 struct pwd has no pw_gecos field
+ #-------------------------------------------
+ 
+ echo $ac_n "checking pw_gecos in struct pwd""... $ac_c" 1>&6
+ echo "configure:1505: checking pw_gecos in struct pwd" >&5
+ cat > conftest.$ac_ext <<EOF
+ #line 1507 "configure"
+ #include "confdefs.h"
+ #include <pwd.h>
+ int main() {
+ struct passwd pwd; pwd.pw_gecos;
+ ; return 0; }
+ EOF
+ if { (eval echo configure:1514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+   rm -rf conftest*
+   tk_ok=yes
+ else
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   tk_ok=no
+ fi
+ rm -f conftest*
+ echo "$ac_t""$tk_ok" 1>&6
+ if test $tk_ok = yes; then
+     cat >> confdefs.h <<\EOF
+ #define HAVE_PW_GECOS 1
+ EOF
+ 
+ fi
+ 
  #--------------------------------------------------------------------
  #Locate the X11 header files and the X11 library archive.  Try
  #the ac_path_x macro first, but if it doesn't find the X stuff
*** generic/tkCanvPs.c.orgWed Sep 30 04:16:44 1998
--- generic/tkCanvPs.cTue Mar 23 13:22:09 1999
***************
*** 711,717 ****

      Tcl_AppendResult(canvasPtr->interp, "%!PS-Adobe-3.0 EPSF-3.0\n",
      "%%Creator: Tk Canvas Widget\n", (char *) NULL);
! #if !(defined(__WIN32__) || defined(MAC_TCL))
      if (!Tcl_IsSafe(interp)) {
  struct passwd *pwPtr = getpwuid(getuid());/* INTL: Native. */
  Tcl_AppendResult(canvasPtr->interp, "%%For: ",
--- 711,717 ----

      Tcl_AppendResult(canvasPtr->interp, "%!PS-Adobe-3.0 EPSF-3.0\n",
      "%%Creator: Tk Canvas Widget\n", (char *) NULL);
! #ifdef HAVE_PW_GECOS
      if (!Tcl_IsSafe(interp)) {
  struct passwd *pwPtr = getpwuid(getuid());/* INTL: Native. */
  Tcl_AppendResult(canvasPtr->interp, "%%For: ",
***************
*** 719,725 ****
  (char *) NULL);
  endpwent();
      }
! #endif /* __WIN32__ || MAC_TCL */
      Tcl_AppendResult(canvasPtr->interp, "%%Title: Window ",
      Tk_PathName(canvasPtr->tkwin), "\n", (char *) NULL);
      time(&now);
--- 719,725 ----
  (char *) NULL);
  endpwent();
      }
! #endif /* HAVE_PW_GECOS */
      Tcl_AppendResult(canvasPtr->interp, "%%Title: Window ",
      Tk_PathName(canvasPtr->tkwin), "\n", (char *) NULL);
      time(&now);

PatchFiles:
configure.in
    configure
    tkCanvPs.c



04/05/1999 12:04 - pat -duplicate of 1604