• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/irda-utils/0001-daemon.patch
Peter KorsgaardPeter Korsgaard committed 298cd8eaa2103 Feb 2015
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
written by Mike Frysinger
2
​
3
https://sourceforge.net/tracker/?func=detail&aid=3132053&group_id=5616&atid=305616
4
​
5
Rather than using the fork function (which doesnt work on nommu
6
systems), simply use the daemon() function instead (which does
7
work). this should work the same before and after for all systems.
8
​
9
--- a/irattach/util.c
10
+++ b/irattach/util.c
11
@@ -156,21 +156,10 @@
12
 
13
 void fork_now(int ttyfd)
14
 {
15
-   int ret;
16
    int i;
17
 
18
-   if ((ret = fork()) > 0)
19
-       exit(0);
20
-   
21
-   if (ret == -1)
22
-       syslog(LOG_INFO, "forking: %m");
23
-   if (setsid() < 0)
24
-       syslog(LOG_INFO, "detaching from tty: %m");
25
-
26
-   if ((ret = fork()) > 0) {
27
-       /* cleanup_files = 0; */
28
-       exit(0);
29
-   }
30
+   if (daemon(1, 1))
31
+       syslog(LOG_INFO, "daemon: %m");
32
 
33
    /* Close all open inherited files! Except for ttyfd! */
34
    for (i = 0; i < 64; i++)
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.