Browse Source

misc: Replace all remaining instances of 'cgminer' with 'sgminer'.

sed again.
nfactor-troky
Noel Maersk 11 years ago
parent
commit
50066cf3c7
  1. BIN
      MCast.class
  2. 4
      MCast.java
  3. 2
      adl.c
  4. 2
      api-example.c
  5. 2
      api-example.php
  6. 2
      api-example.py
  7. 20
      api.c
  8. 2
      bench_block.h
  9. 2
      driver-opencl.c
  10. 14
      miner.h
  11. 22
      miner.php
  12. 4
      ocl.c
  13. 46
      sgminer.c
  14. 40
      util.c
  15. 4
      util.h

BIN
MCast.class

Binary file not shown.

4
MCast.java

@ -53,7 +53,7 @@ class MCast implements Runnable @@ -53,7 +53,7 @@ class MCast implements Runnable
System.err.println("usAge: java MCast [-v] [code [toaddr [port [replyport [wait]]]]]");
System.err.println(" -v=report elapsed ms to last reply");
System.err.println(" Anything below missing or blank will use it's default");
System.err.println(" code=X in cgminer-X-Port default="+MCAST_CODE);
System.err.println(" code=X in sgminer-X-Port default="+MCAST_CODE);
System.err.println(" toaddr=multicast address default="+MCAST_ADDR);
System.err.println(" port=multicast port default="+MCAST_PORT);
System.err.println(" replyport=local post to listen for replies default="+MCAST_REPORT);
@ -188,7 +188,7 @@ class MCast implements Runnable @@ -188,7 +188,7 @@ class MCast implements Runnable
{
try
{
String message = new String("cgminer-" + code + "-" + report);
String message = new String("sgminer-" + code + "-" + report);
MulticastSocket socket = null;
DatagramPacket packet = null;

2
adl.c

@ -790,7 +790,7 @@ int gpu_fanpercent(int gpu) @@ -790,7 +790,7 @@ int gpu_fanpercent(int gpu)
/* Recursive calling applog causes a hang, so disable messages */
applog(LOG_WARNING, "GPU %d stopped reporting fanspeed due to driver corruption", gpu);
if (opt_restart) {
applog(LOG_WARNING, "Restart enabled, will attempt to restart cgminer");
applog(LOG_WARNING, "Restart enabled, will attempt to restart sgminer");
applog(LOG_WARNING, "You can disable this with the --no-restart option");
app_restart();
}

2
api-example.c

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
*/
/* Compile:
* gcc api-example.c -Icompat/jansson-2.5 -Icompat/libusb-1.0/libusb -o cgminer-api
* gcc api-example.c -Icompat/jansson-2.5 -Icompat/libusb-1.0/libusb -o sgminer-api
*/
#include "config.h"

2
api-example.php

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<?php
#
# Sample Socket I/O to CGMiner API
# Sample Socket I/O to sgminer API
#
function getsock($addr, $port)
{

2
api-example.py

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
# Foundation; either version 3 of the License, or (at your option) any later
# version. See COPYING for more details.
#Short Python Example for connecting to The Cgminer API
#Short Python Example for connecting to The sgminer API
#Written By: setkeh <https://github.com/setkeh>
#Thanks to Jezzz for all his Support.
#NOTE: When adding a param with a pipe | in bash or ZSH you must wrap the arg in quotes

20
api.c

@ -379,7 +379,7 @@ struct CODES { @@ -379,7 +379,7 @@ struct CODES {
{ SEVERITY_ERR, MSG_NOGPUADL,PARAM_GPU, "GPU %d does not have ADL" },
{ SEVERITY_ERR, MSG_INVINT, PARAM_STR, "Invalid intensity (%s) - must be '" _DYNAMIC "' or range " MIN_INTENSITY_STR " - " MAX_INTENSITY_STR },
{ SEVERITY_INFO, MSG_GPUINT, PARAM_BOTH, "GPU %d set new intensity to %s" },
{ SEVERITY_SUCC, MSG_MINECONFIG,PARAM_NONE, "CGMiner config" },
{ SEVERITY_SUCC, MSG_MINECONFIG,PARAM_NONE, "sgminer config" },
{ SEVERITY_ERR, MSG_GPUMERR, PARAM_BOTH, "Setting GPU %d memoryclock to (%s) reported failure" },
{ SEVERITY_SUCC, MSG_GPUMEM, PARAM_BOTH, "Setting GPU %d memoryclock to (%s) reported success" },
{ SEVERITY_ERR, MSG_GPUEERR, PARAM_BOTH, "Setting GPU %d clock to (%s) reported failure" },
@ -409,13 +409,13 @@ struct CODES { @@ -409,13 +409,13 @@ struct CODES {
{ SEVERITY_SUCC, MSG_REMPOOL, PARAM_BOTH, "Removed pool %d:'%s'" },
{ SEVERITY_SUCC, MSG_NOTIFY, PARAM_NONE, "Notify" },
{ SEVERITY_SUCC, MSG_DEVDETAILS,PARAM_NONE, "Device Details" },
{ SEVERITY_SUCC, MSG_MINESTATS,PARAM_NONE, "CGMiner stats" },
{ SEVERITY_SUCC, MSG_MINESTATS,PARAM_NONE, "sgminer stats" },
{ SEVERITY_ERR, MSG_MISCHK, PARAM_NONE, "Missing check cmd" },
{ SEVERITY_SUCC, MSG_CHECK, PARAM_NONE, "Check command" },
{ SEVERITY_ERR, MSG_MISBOOL, PARAM_NONE, "Missing parameter: true/false" },
{ SEVERITY_ERR, MSG_INVBOOL, PARAM_NONE, "Invalid parameter should be true or false" },
{ SEVERITY_SUCC, MSG_FOO, PARAM_BOOL, "Failover-Only set to %s" },
{ SEVERITY_SUCC, MSG_MINECOIN,PARAM_NONE, "CGMiner coin" },
{ SEVERITY_SUCC, MSG_MINECOIN,PARAM_NONE, "sgminer coin" },
{ SEVERITY_SUCC, MSG_DEBUGSET,PARAM_NONE, "Debug settings" },
{ SEVERITY_SUCC, MSG_SETCONFIG,PARAM_SET, "Set config '%s' to %d" },
{ SEVERITY_ERR, MSG_UNKCON, PARAM_STR, "Unknown config '%s'" },
@ -2197,7 +2197,7 @@ static void poolpriority(struct io_data *io_data, __maybe_unused SOCKETTYPE c, c @@ -2197,7 +2197,7 @@ static void poolpriority(struct io_data *io_data, __maybe_unused SOCKETTYPE c, c
char *ptr, *next;
int i, pr, prio = 0;
// TODO: all cgminer code needs a mutex added everywhere for change
// TODO: all sgminer code needs a mutex added everywhere for change
// access to total_pools and also parts of the pools[] array,
// just copying total_pools here wont solve that
@ -2725,7 +2725,7 @@ void dosave(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *param, b @@ -2725,7 +2725,7 @@ void dosave(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *param, b
ptr = NULL;
}
static int itemstats(struct io_data *io_data, int i, char *id, struct cgminer_stats *stats, struct cgminer_pool_stats *pool_stats, struct api_data *extra, struct cgpu_info *cgpu, bool isjson)
static int itemstats(struct io_data *io_data, int i, char *id, struct sgminer_stats *stats, struct sgminer_pool_stats *pool_stats, struct api_data *extra, struct cgpu_info *cgpu, bool isjson)
{
struct api_data *root = NULL;
char buf[TMPBUFSIZ];
@ -2795,7 +2795,7 @@ static void minerstats(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m @@ -2795,7 +2795,7 @@ static void minerstats(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m
extra = NULL;
sprintf(id, "%s%d", cgpu->drv->name, cgpu->device_id);
i = itemstats(io_data, i, id, &(cgpu->cgminer_stats), NULL, extra, cgpu, isjson);
i = itemstats(io_data, i, id, &(cgpu->sgminer_stats), NULL, extra, cgpu, isjson);
}
}
@ -2803,7 +2803,7 @@ static void minerstats(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m @@ -2803,7 +2803,7 @@ static void minerstats(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m
struct pool *pool = pools[j];
sprintf(id, "POOL%d", j);
i = itemstats(io_data, i, id, &(pool->cgminer_stats), &(pool->cgminer_pool_stats), NULL, NULL, isjson);
i = itemstats(io_data, i, id, &(pool->sgminer_stats), &(pool->sgminer_pool_stats), NULL, NULL, isjson);
}
if (isjson && io_open)
@ -3437,7 +3437,7 @@ static void *quit_thread(__maybe_unused void *userdata) @@ -3437,7 +3437,7 @@ static void *quit_thread(__maybe_unused void *userdata)
mutex_unlock(&quit_restart_lock);
if (opt_debug)
applog(LOG_DEBUG, "API: killing cgminer");
applog(LOG_DEBUG, "API: killing sgminer");
kill_work();
@ -3451,7 +3451,7 @@ static void *restart_thread(__maybe_unused void *userdata) @@ -3451,7 +3451,7 @@ static void *restart_thread(__maybe_unused void *userdata)
mutex_unlock(&quit_restart_lock);
if (opt_debug)
applog(LOG_DEBUG, "API: restarting cgminer");
applog(LOG_DEBUG, "API: restarting sgminer");
app_restart();
@ -3503,7 +3503,7 @@ static void mcast() @@ -3503,7 +3503,7 @@ static void mcast()
bool addrok;
char group;
char expect[] = "cgminer-"; // first 8 bytes constant
char expect[] = "sgminer-"; // first 8 bytes constant
char *expect_code;
size_t expect_code_len;
char buf[1024];

2
bench_block.h

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
#define __BENCH_BLOCK_H__ 1
// Random work pulled from a pool
#define CGMINER_BENCHMARK_BLOCK \
#define SGMINER_BENCHMARK_BLOCK \
0x00, 0x00, 0x00, 0x01, 0x20, 0x00, 0xD8, 0x07, 0x17, 0xC9, 0x13, 0x6F, 0xDC, 0xBE, 0xDE, 0xB7, \
0xB2, 0x14, 0xEF, 0xD1, 0x72, 0x7F, 0xA3, 0x72, 0xB2, 0x5D, 0x88, 0xF0, 0x00, 0x00, 0x05, 0xAA, \
0x00, 0x00, 0x00, 0x00, 0x92, 0x8B, 0x4C, 0x77, 0xF5, 0xB2, 0xE6, 0x56, 0x96, 0x27, 0xE0, 0x66, \

2
driver-opencl.c

@ -1119,7 +1119,7 @@ static bool opencl_thread_prepare(struct thr_info *thr) @@ -1119,7 +1119,7 @@ static bool opencl_thread_prepare(struct thr_info *thr)
applog(LOG_ERR, "Failed to init GPU thread %d, disabling device %d", i, gpu);
if (!failmessage) {
applog(LOG_ERR, "Restarting the GPU from the menu will not fix this.");
applog(LOG_ERR, "Try restarting cgminer.");
applog(LOG_ERR, "Try restarting sgminer.");
failmessage = true;
#ifdef HAVE_CURSES
char *buf;

14
miner.h

@ -403,7 +403,7 @@ enum dev_reason { @@ -403,7 +403,7 @@ enum dev_reason {
#define MIN_SEC_UNSET 99999999
struct cgminer_stats {
struct sgminer_stats {
uint32_t getwork_calls;
struct timeval getwork_wait;
struct timeval getwork_wait_max;
@ -411,7 +411,7 @@ struct cgminer_stats { @@ -411,7 +411,7 @@ struct cgminer_stats {
};
// Just the actual network getworks to the pool
struct cgminer_pool_stats {
struct sgminer_pool_stats {
uint32_t getwork_calls;
uint32_t getwork_attempts;
struct timeval getwork_wait;
@ -436,7 +436,7 @@ struct cgminer_pool_stats { @@ -436,7 +436,7 @@ struct cgminer_pool_stats {
};
struct cgpu_info {
int cgminer_id;
int sgminer_id;
struct device_drv *drv;
int device_id;
char *name;
@ -517,7 +517,7 @@ struct cgpu_info { @@ -517,7 +517,7 @@ struct cgpu_info {
int dev_comms_error_count;
int dev_throttle_count;
struct cgminer_stats cgminer_stats;
struct sgminer_stats sgminer_stats;
pthread_rwlock_t qlock;
struct work *queued_work;
@ -951,7 +951,7 @@ extern bool opt_protocol; @@ -951,7 +951,7 @@ extern bool opt_protocol;
extern bool have_longpoll;
extern char *opt_kernel_path;
extern char *opt_socks_proxy;
extern char *cgminer_path;
extern char *sgminer_path;
extern bool opt_fail_only;
extern bool opt_autofan;
extern bool opt_autoengine;
@ -1214,8 +1214,8 @@ struct pool { @@ -1214,8 +1214,8 @@ struct pool {
double last_share_diff;
uint64_t best_diff;
struct cgminer_stats cgminer_stats;
struct cgminer_pool_stats cgminer_pool_stats;
struct sgminer_stats sgminer_stats;
struct sgminer_pool_stats sgminer_pool_stats;
/* The last block this particular pool knows about */
char prev_block[32];

22
miner.php

@ -22,7 +22,7 @@ $doctype = "<!DOCTYPE html>\n"; @@ -22,7 +22,7 @@ $doctype = "<!DOCTYPE html>\n";
$title = 'Mine';
#
# Set $readonly to true to force miner.php to be readonly
# Set $readonly to false then it will check cgminer 'privileged'
# Set $readonly to false then it will check sgminer 'privileged'
$readonly = false;
#
# Set $userlist to null to allow anyone access or read API-README
@ -44,7 +44,7 @@ $checklastshare = true; @@ -44,7 +44,7 @@ $checklastshare = true;
# N.B. also if $readonly is true, it will not display the fields
$poolinputs = false;
#
# Set $rigs to an array of your cgminer rigs that are running
# Set $rigs to an array of your sgminer rigs that are running
# format: 'IP:Port' or 'Host:Port' or 'Host:Port:Name'
$rigs = array('127.0.0.1:4028');
#
@ -54,16 +54,16 @@ $mcast = false; @@ -54,16 +54,16 @@ $mcast = false;
# Set $mcastexpect to at least how many rigs you expect it to find
$mcastexpect = 0;
#
# API Multicast address all cgminers are listening on
# API Multicast address all sgminers are listening on
$mcastaddr = '224.0.0.75';
#
# API Multicast UDP port all cgminers are listening on
# API Multicast UDP port all sgminers are listening on
$mcastport = 4028;
#
# The code all cgminers expect in the Multicast message sent
# The code all sgminers expect in the Multicast message sent
$mcastcode = 'FTW';
#
# UDP port cgminers are to reply on (by request)
# UDP port sgminers are to reply on (by request)
$mcastlistport = 4027;
#
# Set $mcasttimeout to the number of seconds (floating point)
@ -437,7 +437,7 @@ function mcastrigs() @@ -437,7 +437,7 @@ function mcastrigs()
return;
}
$buf = "cgminer-$mcastcode-$mcastlistport";
$buf = "sgminer-$mcastcode-$mcastlistport";
socket_sendto($mcast_soc, $buf, strlen($buf), 0, $mcastaddr, $mcastport);
socket_close($mcast_soc);
@ -1569,7 +1569,7 @@ function rigbutton($rig, $rigname, $when, $row) @@ -1569,7 +1569,7 @@ function rigbutton($rig, $rigname, $when, $row)
#
function showrigs($anss, $headname, $rigname)
{
$dthead = array($headname => 1, 'STATUS' => 1, 'Description' => 1, 'When' => 1, 'API' => 1, 'CGMiner' => 1);
$dthead = array($headname => 1, 'STATUS' => 1, 'Description' => 1, 'When' => 1, 'API' => 1, 'sgminer' => 1);
showhead('', $dthead);
foreach ($anss as $rig => $ans)
@ -1850,8 +1850,8 @@ function pagebuttons($rig, $pg) @@ -1850,8 +1850,8 @@ function pagebuttons($rig, $pg)
$rg = '';
if (count($rigs) > 1)
$rg = " Rig $rig";
echo "<input type=button value='Restart' onclick='prc(\"restart&rig=$rig\",\"Restart CGMiner$rg\")'>";
echo "&nbsp;<input type=button value='Quit' onclick='prc(\"quit&rig=$rig\",\"Quit CGMiner$rg\")'>";
echo "<input type=button value='Restart' onclick='prc(\"restart&rig=$rig\",\"Restart sgminer$rg\")'>";
echo "&nbsp;<input type=button value='Quit' onclick='prc(\"quit&rig=$rig\",\"Quit sgminer$rg\")'>";
}
refreshbuttons();
if (isset($_SESSION[$ses]))
@ -1881,7 +1881,7 @@ function doOne($rig, $preprocess) @@ -1881,7 +1881,7 @@ function doOne($rig, $preprocess)
if ($notify)
$cmds['notify'] = 'device status';
$cmds['config'] = 'cgminer config';
$cmds['config'] = 'sgminer config';
process($cmds, $rig);

4
ocl.c

@ -47,8 +47,8 @@ char *file_contents(const char *filename, int *length) @@ -47,8 +47,8 @@ char *file_contents(const char *filename, int *length)
/* Try in the optional kernel path or installed prefix first */
f = fopen(fullpath, "rb");
if (!f) {
/* Then try from the path cgminer was called */
strcpy(fullpath, cgminer_path);
/* Then try from the path sgminer was called */
strcpy(fullpath, sgminer_path);
strcat(fullpath, filename);
f = fopen(fullpath, "rb");
}

46
sgminer.c

@ -142,7 +142,7 @@ int opt_tcp_keepalive; @@ -142,7 +142,7 @@ int opt_tcp_keepalive;
#endif
char *opt_kernel_path;
char *cgminer_path;
char *sgminer_path;
#define QUIET (opt_quiet || opt_realquiet)
@ -256,7 +256,7 @@ static struct stratum_share *stratum_shares = NULL; @@ -256,7 +256,7 @@ static struct stratum_share *stratum_shares = NULL;
char *opt_socks_proxy = NULL;
static const char def_conf[] = "cgminer.conf";
static const char def_conf[] = "sgminer.conf";
static char *default_config;
static bool config_loaded;
static int include_count;
@ -960,7 +960,7 @@ static struct opt_table opt_config_table[] = { @@ -960,7 +960,7 @@ static struct opt_table opt_config_table[] = {
"Allow API access only to the given list of [G:]IP[/Prefix] addresses[/subnets]"),
OPT_WITH_ARG("--api-description",
set_api_description, NULL, NULL,
"Description placed in the API status header, default: cgminer version"),
"Description placed in the API status header, default: sgminer version"),
OPT_WITH_ARG("--api-groups",
set_api_groups, NULL, NULL,
"API one letter groups G:cmd:cmd[,P:cmd:*...] defining the cmds a groups can use"),
@ -1001,7 +1001,7 @@ static struct opt_table opt_config_table[] = { @@ -1001,7 +1001,7 @@ static struct opt_table opt_config_table[] = {
"Change multipool strategy from failover to even share balance"),
OPT_WITHOUT_ARG("--benchmark",
opt_set_bool, &opt_benchmark,
"Run cgminer in benchmark mode - produces no shares"),
"Run sgminer in benchmark mode - produces no shares"),
#ifdef HAVE_CURSES
OPT_WITHOUT_ARG("--compact",
opt_set_bool, &opt_compact,
@ -2632,7 +2632,7 @@ out: @@ -2632,7 +2632,7 @@ out:
static bool get_upstream_work(struct work *work, CURL *curl)
{
struct pool *pool = work->pool;
struct cgminer_pool_stats *pool_stats = &(pool->cgminer_pool_stats);
struct sgminer_pool_stats *pool_stats = &(pool->sgminer_pool_stats);
struct timeval tv_elapsed;
json_t *val = NULL;
bool rc = false;
@ -2836,7 +2836,7 @@ static double le256todouble(const void *target) @@ -2836,7 +2836,7 @@ static double le256todouble(const void *target)
*/
static void calc_diff(struct work *work, double known)
{
struct cgminer_pool_stats *pool_stats = &(work->pool->cgminer_pool_stats);
struct sgminer_pool_stats *pool_stats = &(work->pool->sgminer_pool_stats);
double difficulty;
int intdiff;
@ -2876,7 +2876,7 @@ static void calc_diff(struct work *work, double known) @@ -2876,7 +2876,7 @@ static void calc_diff(struct work *work, double known)
static void get_benchmark_work(struct work *work)
{
// Use a random work block pulled from a pool
static uint8_t bench_block[] = { CGMINER_BENCHMARK_BLOCK };
static uint8_t bench_block[] = { SGMINER_BENCHMARK_BLOCK };
size_t bench_size = sizeof(*work);
size_t work_size = sizeof(bench_block);
@ -3437,7 +3437,7 @@ static bool stale_work(struct work *work, bool share) @@ -3437,7 +3437,7 @@ static bool stale_work(struct work *work, bool share)
/* Factor in the average getwork delay of this pool, rounding it up to
* the nearest second */
getwork_delay = pool->cgminer_pool_stats.getwork_wait_rolling * 5 + 1;
getwork_delay = pool->sgminer_pool_stats.getwork_wait_rolling * 5 + 1;
work_expiry -= getwork_delay;
if (unlikely(work_expiry < 5))
work_expiry = 5;
@ -4626,7 +4626,7 @@ void default_save_file(char *filename) @@ -4626,7 +4626,7 @@ void default_save_file(char *filename)
}
else
strcpy(filename, "");
strcat(filename, ".cgminer/");
strcat(filename, ".sgminer/");
mkdir(filename, 0777);
#else
strcpy(filename, "");
@ -5995,8 +5995,8 @@ static void hash_sole_work(struct thr_info *mythr) @@ -5995,8 +5995,8 @@ static void hash_sole_work(struct thr_info *mythr)
struct cgpu_info *cgpu = mythr->cgpu;
struct device_drv *drv = cgpu->drv;
struct timeval getwork_start, tv_start, *tv_end, tv_workstart, tv_lastupdate;
struct cgminer_stats *dev_stats = &(cgpu->cgminer_stats);
struct cgminer_stats *pool_stats;
struct sgminer_stats *dev_stats = &(cgpu->sgminer_stats);
struct sgminer_stats *pool_stats;
/* Try to cycle approximately 5 times before each log update */
const long cycle = opt_log_interval / 5 ? : 1;
const bool primary = (!mythr->device_thread) || mythr->primary_thread;
@ -6054,7 +6054,7 @@ static void hash_sole_work(struct thr_info *mythr) @@ -6054,7 +6054,7 @@ static void hash_sole_work(struct thr_info *mythr)
copy_time(&dev_stats->getwork_wait_min, &getwork_start);
dev_stats->getwork_calls++;
pool_stats = &(work->pool->cgminer_stats);
pool_stats = &(work->pool->sgminer_stats);
addtime(&getwork_start, &pool_stats->getwork_wait);
if (time_more(&getwork_start, &pool_stats->getwork_wait_max))
@ -7335,7 +7335,7 @@ void enable_curses(void) { @@ -7335,7 +7335,7 @@ void enable_curses(void) {
}
#endif
static int cgminer_id_count = 0;
static int sgminer_id_count = 0;
/* Various noop functions for drivers that don't support or need their
* variants. */
@ -7442,7 +7442,7 @@ void enable_device(struct cgpu_info *cgpu) @@ -7442,7 +7442,7 @@ void enable_device(struct cgpu_info *cgpu)
cgpu->deven = DEV_ENABLED;
wr_lock(&devices_lock);
devices[cgpu->cgminer_id = cgminer_id_count++] = cgpu;
devices[cgpu->sgminer_id = sgminer_id_count++] = cgpu;
wr_unlock(&devices_lock);
if (hotplug_mode) {
@ -7604,11 +7604,11 @@ int main(int argc, char *argv[]) @@ -7604,11 +7604,11 @@ int main(int argc, char *argv[])
#endif
opt_kernel_path = alloca(PATH_MAX);
strcpy(opt_kernel_path, SGMINER_PREFIX);
cgminer_path = alloca(PATH_MAX);
sgminer_path = alloca(PATH_MAX);
s = strdup(argv[0]);
strcpy(cgminer_path, dirname(s));
strcpy(sgminer_path, dirname(s));
free(s);
strcat(cgminer_path, "/");
strcat(sgminer_path, "/");
devcursor = 8;
logstart = devcursor + 1;
@ -7675,7 +7675,7 @@ int main(int argc, char *argv[]) @@ -7675,7 +7675,7 @@ int main(int argc, char *argv[])
case -1:
applog(LOG_WARNING, "Error in configuration file, partially loaded.");
if (use_curses)
applog(LOG_WARNING, "Start cgminer with -T to see what failed to load.");
applog(LOG_WARNING, "Start sgminer with -T to see what failed to load.");
break;
default:
break;
@ -7730,7 +7730,7 @@ int main(int argc, char *argv[]) @@ -7730,7 +7730,7 @@ int main(int argc, char *argv[])
devices[i]->deven = DEV_DISABLED;
}
}
total_devices = cgminer_id_count;
total_devices = sgminer_id_count;
} else {
for (i = 0; i < total_devices; ++i)
enable_device(devices[i]);
@ -7744,7 +7744,7 @@ int main(int argc, char *argv[]) @@ -7744,7 +7744,7 @@ int main(int argc, char *argv[])
load_temp_cutoffs();
for (i = 0; i < total_devices; ++i)
devices[i]->cgminer_stats.getwork_wait_min.tv_sec = MIN_SEC_UNSET;
devices[i]->sgminer_stats.getwork_wait_min.tv_sec = MIN_SEC_UNSET;
if (!opt_compact) {
logstart += most_devices;
@ -7773,8 +7773,8 @@ int main(int argc, char *argv[]) @@ -7773,8 +7773,8 @@ int main(int argc, char *argv[])
struct pool *pool = pools[i];
size_t siz;
pool->cgminer_stats.getwork_wait_min.tv_sec = MIN_SEC_UNSET;
pool->cgminer_pool_stats.getwork_wait_min.tv_sec = MIN_SEC_UNSET;
pool->sgminer_stats.getwork_wait_min.tv_sec = MIN_SEC_UNSET;
pool->sgminer_pool_stats.getwork_wait_min.tv_sec = MIN_SEC_UNSET;
if (!pool->rpc_userpass) {
if (!pool->rpc_user || !pool->rpc_pass)
@ -7874,7 +7874,7 @@ int main(int argc, char *argv[]) @@ -7874,7 +7874,7 @@ int main(int argc, char *argv[])
#ifdef HAVE_CURSES
if (use_curses) {
halfdelay(150);
applog(LOG_ERR, "Press any key to exit, or cgminer will try again in 15s.");
applog(LOG_ERR, "Press any key to exit, or sgminer will try again in 15s.");
if (getch() != ERR)
quit(0, "No servers could be used! Exiting.");
cbreak();

40
util.c

@ -280,12 +280,12 @@ static int curl_debug_cb(__maybe_unused CURL *handle, curl_infotype type, @@ -280,12 +280,12 @@ static int curl_debug_cb(__maybe_unused CURL *handle, curl_infotype type,
case CURLINFO_HEADER_IN:
case CURLINFO_DATA_IN:
case CURLINFO_SSL_DATA_IN:
pool->cgminer_pool_stats.net_bytes_received += size;
pool->sgminer_pool_stats.net_bytes_received += size;
break;
case CURLINFO_HEADER_OUT:
case CURLINFO_DATA_OUT:
case CURLINFO_SSL_DATA_OUT:
pool->cgminer_pool_stats.net_bytes_sent += size;
pool->sgminer_pool_stats.net_bytes_sent += size;
break;
case CURLINFO_TEXT:
default:
@ -419,12 +419,12 @@ json_t *json_rpc_call(CURL *curl, const char *url, @@ -419,12 +419,12 @@ json_t *json_rpc_call(CURL *curl, const char *url,
goto err_out;
}
pool->cgminer_pool_stats.times_sent++;
pool->sgminer_pool_stats.times_sent++;
if (curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD, &byte_count) == CURLE_OK)
pool->cgminer_pool_stats.bytes_sent += byte_count;
pool->cgminer_pool_stats.times_received++;
pool->sgminer_pool_stats.bytes_sent += byte_count;
pool->sgminer_pool_stats.times_received++;
if (curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &byte_count) == CURLE_OK)
pool->cgminer_pool_stats.bytes_received += byte_count;
pool->sgminer_pool_stats.bytes_received += byte_count;
if (probing) {
pool->probed = true;
@ -451,10 +451,10 @@ json_t *json_rpc_call(CURL *curl, const char *url, @@ -451,10 +451,10 @@ json_t *json_rpc_call(CURL *curl, const char *url,
}
*rolltime = hi.rolltime;
pool->cgminer_pool_stats.rolltime = hi.rolltime;
pool->cgminer_pool_stats.hadrolltime = hi.hadrolltime;
pool->cgminer_pool_stats.canroll = hi.canroll;
pool->cgminer_pool_stats.hadexpire = hi.hadexpire;
pool->sgminer_pool_stats.rolltime = hi.rolltime;
pool->sgminer_pool_stats.hadrolltime = hi.hadrolltime;
pool->sgminer_pool_stats.canroll = hi.canroll;
pool->sgminer_pool_stats.hadexpire = hi.hadexpire;
val = JSON_LOADS(all_data.buf, &err);
if (!val) {
@ -929,7 +929,7 @@ static void __maybe_unused timersubspec(struct timespec *a, const struct timespe @@ -929,7 +929,7 @@ static void __maybe_unused timersubspec(struct timespec *a, const struct timespe
}
}
/* These are cgminer specific sleep functions that use an absolute nanosecond
/* These are sgminer specific sleep functions that use an absolute nanosecond
* resolution timer to avoid poor usleep accuracy and overruns. */
#ifdef WIN32
/* Windows start time is since 1601 LOL so convert it to unix epoch 1970. */
@ -950,7 +950,7 @@ static void decius_time(lldiv_t *lidiv) @@ -950,7 +950,7 @@ static void decius_time(lldiv_t *lidiv)
*lidiv = lldiv(li.QuadPart, 10000000);
}
/* This is a cgminer gettimeofday wrapper. Since we always call gettimeofday
/* This is a sgminer gettimeofday wrapper. Since we always call gettimeofday
* with tz set to NULL, and windows' default resolution is only 15ms, this
* gives us higher resolution times on windows. */
void cgtime(struct timeval *tv)
@ -1278,9 +1278,9 @@ static enum send_ret __stratum_send(struct pool *pool, char *s, ssize_t len) @@ -1278,9 +1278,9 @@ static enum send_ret __stratum_send(struct pool *pool, char *s, ssize_t len)
len -= sent;
}
pool->cgminer_pool_stats.times_sent++;
pool->cgminer_pool_stats.bytes_sent += ssent;
pool->cgminer_pool_stats.net_bytes_sent += ssent;
pool->sgminer_pool_stats.times_sent++;
pool->sgminer_pool_stats.bytes_sent += ssent;
pool->sgminer_pool_stats.net_bytes_sent += ssent;
return SEND_OK;
}
@ -1445,9 +1445,9 @@ char *recv_line(struct pool *pool) @@ -1445,9 +1445,9 @@ char *recv_line(struct pool *pool)
else
strcpy(pool->sockbuf, "");
pool->cgminer_pool_stats.times_received++;
pool->cgminer_pool_stats.bytes_received += len;
pool->cgminer_pool_stats.net_bytes_received += len;
pool->sgminer_pool_stats.times_received++;
pool->sgminer_pool_stats.bytes_received += len;
pool->sgminer_pool_stats.net_bytes_received += len;
out:
if (!sret)
clear_sock(pool);
@ -1992,7 +1992,7 @@ static bool socks4_negotiate(struct pool *pool, int sockd, bool socks4a) @@ -1992,7 +1992,7 @@ static bool socks4_negotiate(struct pool *pool, int sockd, bool socks4a)
port = atoi(pool->stratum_port);
buf[2] = port >> 8;
buf[3] = port & 0xff;
sprintf(&buf[8], "CGMINER");
sprintf(&buf[8], "SGMINER");
/* See if we've been given an IP address directly to avoid needing to
* resolve it. */
@ -2527,7 +2527,7 @@ void RenameThread(const char* name) @@ -2527,7 +2527,7 @@ void RenameThread(const char* name)
#endif
}
/* cgminer specific wrappers for true unnamed semaphore usage on platforms
/* sgminer specific wrappers for true unnamed semaphore usage on platforms
* that support them and for apple which does not. We use a single byte across
* a pipe to emulate semaphore behaviour there. */
#ifdef __APPLE__

4
util.h

@ -67,7 +67,7 @@ typedef curl_proxytype proxytypes_t; @@ -67,7 +67,7 @@ typedef curl_proxytype proxytypes_t;
typedef int proxytypes_t;
#endif /* HAVE_LIBCURL */
/* cgminer locks, a write biased variant of rwlocks */
/* sgminer locks, a write biased variant of rwlocks */
struct cglock {
pthread_mutex_t mutex;
pthread_rwlock_t rwlock;
@ -75,7 +75,7 @@ struct cglock { @@ -75,7 +75,7 @@ struct cglock {
typedef struct cglock cglock_t;
/* cgminer specific unnamed semaphore implementations to cope with osx not
/* sgminer specific unnamed semaphore implementations to cope with osx not
* implementing them. */
#ifdef __APPLE__
struct cgsem {

Loading…
Cancel
Save