1/*
2 * quit.cpp
3 * (c) 2002, Carlos Hasan, for Haiku.
4 */
5
6#include <stdio.h>
7#include <string.h>
8#include <app/Messenger.h>
9
10int main(int argc, char *argv[])
11{
12	status_t status;
13
14	if (argc != 2) {
15		printf("use: %s mime_sig\n", argv[0]);
16		return 1;
17	}
18
19	BMessenger messenger(argv[1]);
20
21	if (!messenger.IsValid()) {
22		printf("could not find running app with sig %s\n", argv[1]);
23		return 1;
24	}
25
26	if ((status = messenger.SendMessage(B_QUIT_REQUESTED)) != B_OK) {
27		printf("could not send message, %s\n", strerror(status));
28		return 1;
29	}
30
31	return 0;
32}
33
34