media_server: Initial move to BServer

This commit is contained in:
Dario Casalinuovo 2016-04-01 16:46:13 +02:00
parent 6501f7fb63
commit 1199f321ea
2 changed files with 15 additions and 12 deletions

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src servers media ;
SetSubDirSupportedPlatformsBeOSCompatible ; SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders media shared storage ; UsePrivateHeaders media shared storage app ;
UsePrivateSystemHeaders ; UsePrivateSystemHeaders ;
AddResources media_server : media_server.rdef ; AddResources media_server : media_server.rdef ;

View File

@ -37,7 +37,7 @@ char __dont_remove_copyright_from_binary[] = "Copyright (c) 2002, 2003 "
#include <string.h> #include <string.h>
#include <Alert.h> #include <Alert.h>
#include <Application.h> #include <Server.h>
#include <Autolock.h> #include <Autolock.h>
#include <Directory.h> #include <Directory.h>
#include <Roster.h> #include <Roster.h>
@ -69,10 +69,10 @@ NotificationManager* gNotificationManager;
#define REPLY_TIMEOUT ((bigtime_t)500000) #define REPLY_TIMEOUT ((bigtime_t)500000)
class ServerApp : BApplication { class ServerApp : public BServer {
public: public:
ServerApp(); ServerApp(status_t& error);
~ServerApp(); virtual ~ServerApp();
protected: protected:
virtual void ArgvReceived(int32 argc, char** argv); virtual void ArgvReceived(int32 argc, char** argv);
@ -97,9 +97,9 @@ private:
}; };
ServerApp::ServerApp() ServerApp::ServerApp(status_t& error)
: :
BApplication(B_MEDIA_SERVER_SIGNATURE), BServer(B_MEDIA_SERVER_SIGNATURE, true, &error),
fLocker("media server locker") fLocker("media server locker")
{ {
gNotificationManager = new NotificationManager; gNotificationManager = new NotificationManager;
@ -971,8 +971,11 @@ ServerApp::MessageReceived(BMessage* msg)
int int
main() main()
{ {
new ServerApp; status_t status;
be_app->Run(); ServerApp app(status);
delete be_app;
return 0; if (status == B_OK)
app.Run();
return status == B_OK ? EXIT_SUCCESS : EXIT_FAILURE;
} }