Searching how to replace dosfilewarning functionality

Andrey Repin anrdaemon@yandex.ru
Thu Jan 30 07:20:00 GMT 2020


Greetings, Denis Excoffier!

> I do this:
> 1) I replace "bool dos_file_warning;"  with "bool dos_file_warning =
> true;", and recompile cygwin1.dll. This has to be done at a regular basis, at each new version or snapshot.
> 2) In my .cshrc i install "echo \\ /nonexistent*" (or something more
> clever, like "echo \\ /nonexistent* |& head --lines=-6").
> 3) When I login, if I see "Cygwin WARNING:", this means that apart from the
> current process, there is no other Cygwin process in my system. An important
> feature is that the "Cygwin WARNING" message never appears afterwards (in subsequent shells, like in xterm’s).
> 4) If I exit from a shell that has displayed "Cygwin WARNING:", I’m sure
> that no Cygwin process remains (I know that my .cshrc is clean about process creation etc.).

> Is there any alternative to this almost-functionality if this code is removed?

I fail to see why you want to do such mental gymnastics.

Just create a script like

  test $( ps -al | grep -vE "\<${TTY##/dev/}\>" |& wc -l ) -gt 1 && {
    echo There\'s likely other processes running from Cygwin environment.
    echo Please stop them or use --force to suppress this test.
    exit 1
  }

and run it whenever you suspect Cygwin tasks running in background.

[C:\arc\cygwin\install]$ install-cygwin.sh
      PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
     1563       1    1563     187240  ?             18   Jan 29 /usr/bin/cygrunsrv
     1562       1    1562     187172  ?         197608   Jan 29 /usr/bin/ssh-pageant
     1564    1563    1564     190868  ?             18   Jan 29 /usr/sbin/cygserver
There's likely other processes running from Cygwin environment.
Please stop them or use --force to suppress this test.


-- 
With best regards,
Andrey Repin
Thursday, January 30, 2020 10:03:02

Sorry for my terrible english...
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list