Added quit, code by Carlos Hasan.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2155 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
9fbdca8c2b
commit
30dbdd96f9
@ -10,6 +10,7 @@ StdBinCommands
|
|||||||
isvolume.cpp
|
isvolume.cpp
|
||||||
listattr.cpp
|
listattr.cpp
|
||||||
lsindex.cpp
|
lsindex.cpp
|
||||||
|
quit.cpp
|
||||||
setversion.cpp
|
setversion.cpp
|
||||||
shutdown.cpp
|
shutdown.cpp
|
||||||
version.cpp
|
version.cpp
|
||||||
|
33
src/apps/bin/quit.cpp
Normal file
33
src/apps/bin/quit.cpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* quit.cpp
|
||||||
|
* (c) 2002, Carlos Hasan, for OpenBeOS.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <app/Messenger.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
status_t status;
|
||||||
|
|
||||||
|
if (argc != 2) {
|
||||||
|
printf("use: %s mime_sig\n", argv[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
BMessenger messenger(argv[1]);
|
||||||
|
|
||||||
|
if (!messenger.IsValid()) {
|
||||||
|
printf("could not find running app with sig %s\n", argv[1]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((status = messenger.SendMessage(B_QUIT_REQUESTED)) != B_OK) {
|
||||||
|
printf("could not send message, %s\n", strerror(status));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user