|
a/upmpd/upmpdutils.cxx |
|
b/upmpd/upmpdutils.cxx |
|
... |
|
... |
19 |
// This file has a number of mostly uninteresting and badly
|
19 |
// This file has a number of mostly uninteresting and badly
|
20 |
// implemented small utility functions. This is a bit ugly, but I am
|
20 |
// implemented small utility functions. This is a bit ugly, but I am
|
21 |
// not linking to Qt or glib just to get path-concatenating
|
21 |
// not linking to Qt or glib just to get path-concatenating
|
22 |
// functions...
|
22 |
// functions...
|
23 |
|
23 |
|
24 |
#include <unistd.h>
|
24 |
#include "upmpdutils.hxx"
|
25 |
#include <fcntl.h>
|
25 |
|
26 |
#include <sys/types.h>
|
26 |
#include <errno.h> // for errno
|
27 |
#include <sys/stat.h>
|
27 |
#include <fcntl.h> // for open, O_RDONLY, O_CREAT, etc
|
28 |
#include <sys/file.h>
|
28 |
#include <math.h> // for exp10, floor, log10, sqrt
|
29 |
#include <math.h>
|
29 |
#include <pwd.h> // for getpwnam, getpwuid, passwd
|
30 |
#include <pwd.h>
|
30 |
#include <regex.h> // for regmatch_t, regfree, etc
|
31 |
#include <regex.h>
|
31 |
#include <stdio.h> // for sprintf
|
32 |
#include <errno.h>
|
32 |
#include <stdlib.h> // for getenv, strtol
|
33 |
#include <string.h>
|
33 |
#include <string.h> // for strerror, strerror_r
|
34 |
#include <stdlib.h>
|
34 |
#include <sys/file.h> // for flock, LOCK_EX, LOCK_NB
|
|
|
35 |
#include <sys/stat.h> // for fstat, mkdir, stat
|
|
|
36 |
#include <unistd.h> // for close, pid_t, ftruncate, etc
|
|
|
37 |
|
35 |
#ifndef O_STREAMING
|
38 |
#ifndef O_STREAMING
|
36 |
#define O_STREAMING 0
|
39 |
#define O_STREAMING 0
|
37 |
#endif
|
40 |
#endif
|
|
|
41 |
#include <fstream> // for operator<<, basic_ostream, etc
|
|
|
42 |
#include <sstream> // for ostringstream
|
|
|
43 |
#include <utility> // for pair
|
|
|
44 |
#include <vector> // for vector
|
38 |
|
45 |
|
39 |
#include <iostream>
|
46 |
#include "libupnpp/log.hxx" // for LOGERR
|
40 |
#include <sstream>
|
47 |
#include "libupnpp/soaphelp.hxx" // for xmlQuote
|
41 |
#include <fstream>
|
48 |
#include "libupnpp/upnpavutils.hxx" // for upnpduration
|
|
|
49 |
|
|
|
50 |
#include "mpdcli.hxx" // for UpSong
|
|
|
51 |
|
42 |
using namespace std;
|
52 |
using namespace std;
|
43 |
|
|
|
44 |
#include "mpdcli.hxx"
|
|
|
45 |
#include "upmpdutils.hxx"
|
|
|
46 |
#include "libupnpp/log.hxx"
|
|
|
47 |
#include "libupnpp/soaphelp.hxx"
|
|
|
48 |
#include "libupnpp/upnpavutils.hxx"
|
|
|
49 |
|
|
|
50 |
using namespace UPnPP;
|
53 |
using namespace UPnPP;
|
51 |
|
54 |
|
52 |
// Append system error string to input string
|
55 |
// Append system error string to input string
|
53 |
void catstrerror(string *reason, const char *what, int _errno)
|
56 |
void catstrerror(string *reason, const char *what, int _errno)
|
54 |
{
|
57 |
{
|
|
... |
|
... |
535 |
|
538 |
|
536 |
int Pidfile::remove()
|
539 |
int Pidfile::remove()
|
537 |
{
|
540 |
{
|
538 |
return unlink(m_path.c_str());
|
541 |
return unlink(m_path.c_str());
|
539 |
}
|
542 |
}
|
540 |
|
|
|