delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/11/18/16:56:06

From: noer AT cygnus DOT com (Geoffrey Noer)
Subject: Re: small patch to `ps'
18 Nov 1998 16:56:06 -0800 :
Message-ID: <19981118162342.14578.cygnus.cygwin32.developers@cygnus.com>
References: <36535AB1 DOT D5BD9AB4 AT cityweb DOT de>
Mime-Version: 1.0
To: Corinna Vinschen <corinna DOT vinschen AT cityweb DOT de>
Cc: cygwin32-developers AT cygnus DOT com

I committed this patch, changing the size of pname to MAX_PATH and
adding the include file sys/cygwin.h which is where the proto for
cygwin_conv_to_posix_path lives.

-gjn

> Wed Nov 16 23:38:13  Corinna Vinschen <corinna DOT vinschen AT cityweb DOT de>
> 
> 	* utils/ps.cc (main): converting windows paths to posix
> 	paths in output.
> 
> ---- snip ----
> --- ps.cc.orig  Wed Nov 18 23:38:03 1998
> +++ ps.cc       Wed Nov 18 23:38:13 1998
> @@ -115,7 +115,12 @@ main (int argc, char *argv[])
>        else if (p->process_state & PID_TTYOU)
>          status = 'O';
> 
> -      const char *pname = (p->process_state & PID_ZOMBIE) ? "<defunct>" : p->progname;
> +      char pname[512];
> +      if (p->process_state & PID_ZOMBIE)
> +        strcpy (pname, "<defunct>");
> +      else
> +        cygwin_conv_to_posix_path (p->progname, pname);
> +
>        char uname[128];
> 
>        if (fflag)
> 

-- 
Geoffrey Noer
noer AT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019