POV-Ray : Newsgroups : povray.unix : small bugfix in unix.cpp? : small bugfix in unix.cpp? Server Time
8 Jul 2024 17:46:49 EDT (-0400)
  small bugfix in unix.cpp?  
From: fjansson
Date: 8 Jun 2003 05:49:30
Message: <3ee306aa$1@news.povray.org>
I am using povray 3.50c for linux. When I try to start povray remotely on
an other linux box with rsh,

rsh computer povray options

povray segfaults. The problem seems to be theese lines in unix.cpp:

  1840    /* if this isn't actually a TTY, no need for SVGA */
  1841    if (!strstr(ttyname(0), "tty"))
  1842      {
  1843        return (false);
  1844      }

It seems that ttyname returns NULL when run with rsh (maybe there is no real tty?),
and then strstr segfaults. Something similar occurs when I run a script
that does some calculations and then start povray. If I log out before povray is
started
povray crashes, for the same reason, I think.

Inserting the lines:

 if (ttyname(0) == NULL)
    return (false);

before the lines above seems to solve the problem, at least in the first case.
The manpage for ttyname says it returns NULL if an error occurs.
Comments?

Fredrik


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.