Comments (6)
from welle.io.
Just to close this issue, I have written a C wrapper using ptys to solve my problem:
#! /usr/bin/tcc -run
/* Author: Dieter Deyke [email protected] /
/ Time-stamp: <2023-02-03 14:48:36 deyke> */
#define _XOPEN_SOURCE 500
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char **argv)
{
char *channel;
char *program;
char *slave_name;
int master_fd;
if (argc != 2 || strncmp(argv[1], "dab://", 6)) {
fprintf(stderr, "Usage: dabplayer <url>\n");
exit(1);
}
channel = argv[1] + 6;
if (!(program = strchr(channel, '/'))) {
fprintf(stderr, "Usage: dabplayer <url>\n");
exit(1);
}
*program++ = 0;
if ((master_fd = open("/dev/ptmx", O_RDWR, 0600)) < 0) {
perror("open(\"/dev/ptmx\"");
exit(1);
}
if (!(slave_name = ptsname(master_fd))) {
perror("ptsname");
exit(1);
}
if (unlockpt(master_fd)) {
perror("unlockpt");
exit(1);
}
close(0);
if (open(slave_name, O_RDWR) != 0) {
fprintf(stderr, "stdin fd is not 0\n");
exit(1);
}
close(1);
if (open("/dev/null", O_RDWR) != 1) {
fprintf(stderr, "stdout fd is not 1\n");
exit(1);
}
close(2);
if (open("/dev/null", O_RDWR) != 2) {
fprintf(stderr, "stderr fd is not 2\n");
exit(1);
}
execl("/usr/bin/welle-cli", "/usr/bin/welle-cli", "-c", channel, "-p", program, 0);
perror("execl");
return 0;
}
from welle.io.
I was trying to use welle-cli as a sub-process to an interactive text ui. Leaving stdin unchanged welle-cli stole key strokes intended for the parent process. Connecting stdin to /dev/null made welle-cli block and stall, and connecting stdin to /dev/zero made welle-cli leak memory very fast. Do you have any tips how I can achieve my goal?
from welle.io.
@dieterdeyke did you try to use it as documented in /usr/share/doc/welle.io/ ?
https://salsa.debian.org/debian-hamradio-team/welle.io/-/blob/master/debian/README.Debian
from welle.io.
@dieterdeyke I haven't tried your code, but if you think it's worth to be added to upstream, why not suggest so (is it maybe useful to others)? Shall I close the issue?
from welle.io.
from welle.io.
Related Issues (20)
- missing catSLS in welle-cli
- Announcement-info support for welle-cli
- ofdm-processor: SyncOnPhase failed when initiating scan
- [Raspberry Pi] RTL-SDR doesnt get reqognised by welle.io HOT 2
- Windows 10 X64, Welle.io Force Closes on starting program HOT 5
- Looses signal exactly on the hour HOT 2
- welle-io does not scan for stations HOT 2
- station scan doesn't find anything?
- Icons are missing (2.4 Appimage) HOT 3
- Scan is crashing with RTL-SDR V4 HOT 7
- [feature request][welle.io-cli] SLS dynamic change HOT 1
- output device null HOT 2
- Does anyone know how to this program to work with new RTL V4 dongle HOT 5
- Airspy Mini on macos not recognized HOT 1
- Buttons are missing in the GUI in Fedora 38 HOT 3
- Streaming to Sonos? HOT 1
- FreeBSD 14.0: Can't scan for stations HOT 6
- [rtl_tcp] How to enter a big (>8000) port number
- Extreme badly Reception with DVB T stick and active antenna HOT 3
- No channels founds during scan with RTL-SDR-V4, but scanning process appears to happen HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from welle.io.